Re: [rust-dev] adding a new cross-compile target

2014-07-20 Thread Valerii Hiora
Hi Rob,

> make: *** No rule to make target 
> `powerpc64-bgq-linux/rt/arch/powerpc64/morestack.o', needed by 
> `powerpc64-bgq-linux/rt/libsmorestack.a'.  Stop.
>
> I don't know how to go about debugging this.   Any ideas?

  There is no way to "debug" this - you have to implement a couple of
functions which are required by Rust runtime and are
architecture-dependent. They live in src/rt/arch/$ARCH_NAME$

  Functions (files) are:

  morestack (morestack.S) - it is a vestige from segmented stack time.
Back then it allocated a new stack segment once were wasn't enough space
in the current one. Nowadays it just calls rust_stack_exhausted function.

  record_sp_limit (record_sp.S) - should store stack limit for current
task (usually it uses platform specific thread local storage).

  get_sp_limit (record_sp.S) - should return stack limit for current
task (reads from the same platform-specific thread local storage)

  rust_swap_registers (_context.S) - I'm not sure about this one, but I
assume it allows correct register restoration in case of green task
switches.

  rust_bootstrap_green_task (_context.S) - again, not sure, but I assume
it initializes green task.

  Note, that all stack-related functions (morestack, record_sp_limit,
get_sp_limit) should be actually compatible with LLVM segmented stack
prologue (in your case consult
$LLVM/lib/target/PowerPC/PPCFrameLowering.cpp, emitPrologue and
emitEpilogue methods, may be a couple of others).

  For a reference implementations (and much more additional comments)
see src/rt/arch/i386/*.S

-- 

  Valerii




signature.asc
Description: OpenPGP digital signature
___
Rust-dev mailing list
Rust-dev@mozilla.org
https://mail.mozilla.org/listinfo/rust-dev


Re: [rust-dev] adding a new cross-compile target

2014-07-20 Thread Ilya Dmitrichenko
Hi Rob!

It's probably best to way until porting had been simplified.

Here is a ongoing discussion of this matter:

https://github.com/rust-lang/rfcs/pull/131


Cheers,

-- 

Ilya
On 20 Jul 2014 15:35, "Rob Latham"  wrote:

> I probably picked the exact wrong project for diving into rust, but
> I'd like to teach rust how to build powerpc64-bgq-linux binaries.
>
> I've got a powerpc64-bgq-linux toolchain.   I added this stanza to
> mk/platforms.mk, but cribbed from other platforms.  Did I leave out
> any important settings?
>
> % git diff
> diff --git a/mk/platform.mk b/mk/platform.mk
> index d1ec7c65..f1272eaa 100644
> --- a/mk/platform.mk
> +++ b/mk/platform.mk
> @@ -580,6 +580,19 @@ CFG_LDPATH_x86_64-unknown-freebsd :=
>  CFG_RUN_x86_64-unknown-freebsd=$(2)
>  CFG_RUN_TARG_x86_64-unknown-freebsd=$(call
> CFG_RUN_x86_64-unknown-freebsd,,$(2))
>
> +# powerpc64-bgq-linux configuration
> +CC_powerpc64-bgq-linux=powerpc64-bgq-linux-gcc
> +CXX_powerpc64-bgq-linux=powerpc64-bgq-linux-g++
> +CPP_powerpc64-bgq-linux=powerpc64-bgq-linux-cpp
> +AR_powerpc64-bgq-linux=powerpc64-bgq-linux-ar
> +CFG_LIB_NAME_powerpc64-bgq-linux=libs$(1).so
> +CFG_STATIC_LIB_NAME_powerpc64-bgq-linux=libs$(1).a
> +CFG_LIB_GLOB_powerpc64-bgq-linux=lib$(1)-*.so
> +CFG_CFLAGS_powerpc64-bgq-linux := $(CFLAGS)
> +CFG_GCCISH_CFLAGS_powerpc64-bgq-linux := -Wall -Werror -g -fPIC $(CFLAGS)
> +CFG_UNIXY_powerpc64-bgq-linux := 1
> +CFG_RUN_powerpc64-bgq-linux =
> +CFG_RUN_TARG_powerpc64-bgq-linux =
>
> I can configure ok:
>
>  ../configure --target=powerpc64-bgq-linux
> --prefix=/sandbox/robl/rust-master
>
> But  build progresses pretty far, hanging up here:
>
> [...]
> rustc:
> x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib/librustdoc
> rustc:
> x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib/libfourcc
> rustc:
> x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib/libhexfloat
> rustc:
> x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib/libregex_macros
> make: *** No rule to make target
> `powerpc64-bgq-linux/rt/arch/powerpc64/morestack.o', needed by
> `powerpc64-bgq-linux/rt/libsmorestack.a'.  Stop.
>
> I don't know how to go about debugging this.   Any ideas?
>
> thanks
> ==rob
> ___
> Rust-dev mailing list
> Rust-dev@mozilla.org
> https://mail.mozilla.org/listinfo/rust-dev
>
___
Rust-dev mailing list
Rust-dev@mozilla.org
https://mail.mozilla.org/listinfo/rust-dev


[rust-dev] adding a new cross-compile target

2014-07-20 Thread Rob Latham
I probably picked the exact wrong project for diving into rust, but
I'd like to teach rust how to build powerpc64-bgq-linux binaries.

I've got a powerpc64-bgq-linux toolchain.   I added this stanza to
mk/platforms.mk, but cribbed from other platforms.  Did I leave out
any important settings?

% git diff
diff --git a/mk/platform.mk b/mk/platform.mk
index d1ec7c65..f1272eaa 100644
--- a/mk/platform.mk
+++ b/mk/platform.mk
@@ -580,6 +580,19 @@ CFG_LDPATH_x86_64-unknown-freebsd :=
 CFG_RUN_x86_64-unknown-freebsd=$(2)
 CFG_RUN_TARG_x86_64-unknown-freebsd=$(call
CFG_RUN_x86_64-unknown-freebsd,,$(2))

+# powerpc64-bgq-linux configuration
+CC_powerpc64-bgq-linux=powerpc64-bgq-linux-gcc
+CXX_powerpc64-bgq-linux=powerpc64-bgq-linux-g++
+CPP_powerpc64-bgq-linux=powerpc64-bgq-linux-cpp
+AR_powerpc64-bgq-linux=powerpc64-bgq-linux-ar
+CFG_LIB_NAME_powerpc64-bgq-linux=libs$(1).so
+CFG_STATIC_LIB_NAME_powerpc64-bgq-linux=libs$(1).a
+CFG_LIB_GLOB_powerpc64-bgq-linux=lib$(1)-*.so
+CFG_CFLAGS_powerpc64-bgq-linux := $(CFLAGS)
+CFG_GCCISH_CFLAGS_powerpc64-bgq-linux := -Wall -Werror -g -fPIC $(CFLAGS)
+CFG_UNIXY_powerpc64-bgq-linux := 1
+CFG_RUN_powerpc64-bgq-linux =
+CFG_RUN_TARG_powerpc64-bgq-linux =

I can configure ok:

 ../configure --target=powerpc64-bgq-linux --prefix=/sandbox/robl/rust-master

But  build progresses pretty far, hanging up here:

[...]
rustc: 
x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib/librustdoc
rustc: 
x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib/libfourcc
rustc: 
x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib/libhexfloat
rustc: 
x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib/libregex_macros
make: *** No rule to make target
`powerpc64-bgq-linux/rt/arch/powerpc64/morestack.o', needed by
`powerpc64-bgq-linux/rt/libsmorestack.a'.  Stop.

I don't know how to go about debugging this.   Any ideas?

thanks
==rob
___
Rust-dev mailing list
Rust-dev@mozilla.org
https://mail.mozilla.org/listinfo/rust-dev