public inbox for crossgcc@sourceware.org
 help / color / mirror / Atom feed
* Using CT-NG generated cross-compiler to compile a native compiler w/ sysroot
@ 2020-09-20  3:18 Chris Punches
  2020-09-28  4:27 ` Chris Punches
  0 siblings, 1 reply; 2+ messages in thread
From: Chris Punches @ 2020-09-20  3:18 UTC (permalink / raw)
  To: crossgcc

Hello,

I've made some progress in my efforts to build a suitable sysroot using CT-NG
but could use some information about how to use CT-NG to use existing crosstools
builds for subsequent builds...

I have built a statically linked gnu cross-compiler toolchain using CT-NG at
`/opt/cross-compiler/${target}/bin/${target}-${tool}`.

I have a link to the project here:

https://github.com/SILO-GROUP/Foster-B

The link to my CT-NG config is here:

https://github.com/SILO-GROUP/Foster-B/blob/master/workspace/sources/ctng.x86_64-multilib.config

I intend on using the crosstoolchain it built at `/opt/cross-compiler` to cross-
compile a native compiler toolchain for ${target} (starting out x86_64 multilib,
but there will be other architectures later), also using CT-NG as the
orchestrator, and this target-native toolchain should reside at
`/opt/sysroot/opt/compiler` and have all of its linked dependencies residing in
the parent `/opt/sysroot` directory tree.

To recap, the `/opt/cross-compiler` set runs on the host/build machine and
compiles for ${target} -- and the `/opt/sysroot/opt/compiler` toolchain should
RUN on the target machine and build for the target machine to populate a SYSROOT
at /opt/sysroot.

My question is -- how would I configure CT-NG to use `/opt/cross-
compiler/${target}/bin/${target}-*` during the compilation of the ${target}
toolchain I hope to create at `/opt/sysroot/opt/compiler`?

I looked in the docs for CT-NG which do not cover these types of things that I
can find.  Any help with setting this up would be appreciated.

I have distilled my main questions to a set of 3:

* 1.  

I see a way to specify the SYSROOT path using the config variables
`CT_SYSROOT_DIR_PREFIX` and `CT_SYSROOT_NAME`.  I am assuming I ought set for
these:

```
CT_SYSROOT_DIR=/opt/
CT_SYSROOT_NAME=sysroot
```
Please correct if I am misreading and that will not produce the specs I've
mentioned for the SYSROOT path as these are in the config file but not in the
official documentation at: https://crosstool-ng.github.io/docs/configuration/

This is somewhat confusing because /opt/sysroot does not exist, so there's
ambiguity about whether this is where it generates its toolchain sysroot or if
this is where it expects one to be.  Ideally in same-architecture scenarios I
should be able to chroot into this sysroot and use these tools at /opt/compiler
within it as if they were part of the system.

* 2. 

As you can see, `CT_TARGET_ALIAS` is set to an empty string currently in the
config yet the crosstools' binaries are being prepended with ${TARGET} for their
binary names, so, adding `/opt/cross-compiler/${target}/bin` to ${PATH} prior to
executing CT-NG will not cause it to use the tools in `/opt/cross-compiler`. 
How do I get CT-NG to use them?  Should I use some setting to prevent the
architecture from being prepended to the tool names and put a shim in path or is
there some other means of getting CT-NG to use them?

* 3.  

I am assuming for the `/opt/sysroot/opt/compiler` generation that this should
not be statically linked and that the CT_PREFIX_DIR should be set to
`/opt/sysroot/opt/compiler`.  If anyone is tracking what I'm trying to do,
please let me know if that is not correct.

The reason I ask this is that the CT_PREFIX_DIR variable in the config sample
this was derived from is more complex than that -- `CT_PREFIX_DIR="${CT_PREFIX:-
${CX_DIR}}/${CT_HOST:+HOST-${CT_HOST}/}${CT_TARGET}"`

-

This will be a glibc and linux-utils build; any additional insight that anyone
might find useful to communicate would be appreciated as well; lots of ambiguity
here.

Thanks in advance,

-C



^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Using CT-NG generated cross-compiler to compile a native compiler w/ sysroot
  2020-09-20  3:18 Using CT-NG generated cross-compiler to compile a native compiler w/ sysroot Chris Punches
@ 2020-09-28  4:27 ` Chris Punches
  0 siblings, 0 replies; 2+ messages in thread
From: Chris Punches @ 2020-09-28  4:27 UTC (permalink / raw)
  To: crossgcc

bump

On Sat, 2020-09-19 at 23:18 -0400, Chris Punches via crossgcc wrote:
> Hello,
> 
> I've made some progress in my efforts to build a suitable sysroot using CT-NG
> but could use some information about how to use CT-NG to use existing
> crosstools
> builds for subsequent builds...
> 
> I have built a statically linked gnu cross-compiler toolchain using CT-NG at
> `/opt/cross-compiler/${target}/bin/${target}-${tool}`.
> 
> I have a link to the project here:
> 
> https://github.com/SILO-GROUP/Foster-B
> 
> The link to my CT-NG config is here:
> 
> https://github.com/SILO-GROUP/Foster-B/blob/master/workspace/sources/ctng.x86_64-multilib.config
> 
> I intend on using the crosstoolchain it built at `/opt/cross-compiler` to
> cross-
> compile a native compiler toolchain for ${target} (starting out x86_64
> multilib,
> but there will be other architectures later), also using CT-NG as the
> orchestrator, and this target-native toolchain should reside at
> `/opt/sysroot/opt/compiler` and have all of its linked dependencies residing
> in
> the parent `/opt/sysroot` directory tree.
> 
> To recap, the `/opt/cross-compiler` set runs on the host/build machine and
> compiles for ${target} -- and the `/opt/sysroot/opt/compiler` toolchain should
> RUN on the target machine and build for the target machine to populate a
> SYSROOT
> at /opt/sysroot.
> 
> My question is -- how would I configure CT-NG to use `/opt/cross-
> compiler/${target}/bin/${target}-*` during the compilation of the ${target}
> toolchain I hope to create at `/opt/sysroot/opt/compiler`?
> 
> I looked in the docs for CT-NG which do not cover these types of things that I
> can find.  Any help with setting this up would be appreciated.
> 
> I have distilled my main questions to a set of 3:
> 
> * 1.  
> 
> I see a way to specify the SYSROOT path using the config variables
> `CT_SYSROOT_DIR_PREFIX` and `CT_SYSROOT_NAME`.  I am assuming I ought set for
> these:
> 
> ```
> CT_SYSROOT_DIR=/opt/
> CT_SYSROOT_NAME=sysroot
> ```
> Please correct if I am misreading and that will not produce the specs I've
> mentioned for the SYSROOT path as these are in the config file but not in the
> official documentation at: https://crosstool-ng.github.io/docs/configuration/
> 
> This is somewhat confusing because /opt/sysroot does not exist, so there's
> ambiguity about whether this is where it generates its toolchain sysroot or if
> this is where it expects one to be.  Ideally in same-architecture scenarios I
> should be able to chroot into this sysroot and use these tools at
> /opt/compiler
> within it as if they were part of the system.
> 
> * 2. 
> 
> As you can see, `CT_TARGET_ALIAS` is set to an empty string currently in the
> config yet the crosstools' binaries are being prepended with ${TARGET} for
> their
> binary names, so, adding `/opt/cross-compiler/${target}/bin` to ${PATH} prior
> to
> executing CT-NG will not cause it to use the tools in `/opt/cross-compiler`. 
> How do I get CT-NG to use them?  Should I use some setting to prevent the
> architecture from being prepended to the tool names and put a shim in path or
> is
> there some other means of getting CT-NG to use them?
> 
> * 3.  
> 
> I am assuming for the `/opt/sysroot/opt/compiler` generation that this should
> not be statically linked and that the CT_PREFIX_DIR should be set to
> `/opt/sysroot/opt/compiler`.  If anyone is tracking what I'm trying to do,
> please let me know if that is not correct.
> 
> The reason I ask this is that the CT_PREFIX_DIR variable in the config sample
> this was derived from is more complex than that --
> `CT_PREFIX_DIR="${CT_PREFIX:-
> ${CX_DIR}}/${CT_HOST:+HOST-${CT_HOST}/}${CT_TARGET}"`
> 
> -
> 
> This will be a glibc and linux-utils build; any additional insight that anyone
> might find useful to communicate would be appreciated as well; lots of
> ambiguity
> here.
> 
> Thanks in advance,
> 
> -C
> 
> 
> --
> For unsubscribe information see http://sourceware.org/lists.html#faq


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-09-28  4:27 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-20  3:18 Using CT-NG generated cross-compiler to compile a native compiler w/ sysroot Chris Punches
2020-09-28  4:27 ` Chris Punches

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).