Skip to contentSkip to conversation

gcc: Add option to build final-gcc with sysroot option

PATCH New Peter Korsgaard 1 participant 4 messages Nov 27, 2009 – Nov 30, 2009 3 messages not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw

PATCH 1/1 gcc: Add option to build final-gcc with sysroot option

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Carmelo" == Carmelo AMOROSO <[email protected]> writes:

Hi,

Thanks for the patch.

Carmelo> Add gcc config option BR2_GCC_FINAL_NEEDS_SYSROOT to build cross gcc Carmelo> (final stage) with --with-sysroot option.
Carmelo> This is required to allow libgcc to use the correct the correct unwind Carmelo> functions implementation with NPTL.

Carmelo> Indeed, if sysroot is not used, the inhibit_libc macro is defined Carmelo> for the LIBGCC2_CFLAGS (see gcc/configure)

Carmelo> inhibit_libc=false
Carmelo> if { { test x$host != x$target && test "x$with_sysroot" = x ; } ||
Carmelo> test x$with_newlib = xyes ; } &&
Carmelo> { test "x$with_headers" = x || test "x$with_headers" = xno ; } ; then
Carmelo> inhibit_libc=true
Carmelo> fi

Carmelo> If inhibit_libc is defined, the actual implementation of unwind functions Carmelo> are taken from unwind-dw2-fde-c instead of the correct unwind-dw2-fde-glibc.c Carmelo> as required for NPTL case.

<cut>

Carmelo> +config BR2_GCC_FINAL_NEEDS_SYSROOT
Carmelo> + bool "Gcc (final stage) needs sysroot to be set"
Carmelo> + default n
Carmelo> + help

 Carmelo> +	  If enabled, gcc (final stage) will be configured with --with-sysroot
 Carmelo> +	  set to $(STAGING_DIR) where uClibc runtime system has been installed.
 Carmelo> +	  This is required for building a toolchain working with uClibc NPTL.

Carmelo> +

I'm not convinced we need a user visible option for this - It's a very lowlevel detail that I don't think most users will know what to answer to - Any reason we cannot just automatically enable this if BR2_PTHREADS_NATIVE is enabled?

Signature · 1 line
Bye, Peter Korsgaard

A message that is not in the archive (sent off-list or not yet received): [email protected]

#3 lore raw

PATCH 1/1 gcc: Add option to build final-gcc with sysroot option

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Carmelo" == Carmelo AMOROSO <[email protected]> writes:

Hi,

Quoted 4 lines
Quoted 4 lines

I'm not convinced we need a user visible option for this - It's a very lowlevel detail that I don't think most users will know what to answer to - Any reason we cannot just automatically enable this if BR2_PTHREADS_NATIVE is enabled?

Carmelo> No at all, indeed it is the better choice. Feel free to Carmelo> rework/adapt it.

Ok, will do - Thanks.

Signature · 1 line
Bye, Peter Korsgaard
#4 lore raw

PATCH 1/1 gcc: Add option to build final-gcc with sysroot option

In reply to a message not in the archive
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Carmelo" == Carmelo AMOROSO <[email protected]> writes:

Hi,

Quoted 5 lines
Quoted 5 lines

I'm not convinced we need a user visible option for this - It's a very lowlevel detail that I don't think most users will know what to answer to - Any reason we cannot just automatically enable this if BR2_PTHREADS_NATIVE is enabled?

Carmelo> No at all, indeed it is the better choice. Feel free to Carmelo> rework/adapt it.

Hmm, looking closer at it you're having me confused. You changed gcc-uclibc-3.x.mk (E.G. the build rules used when NOT using sysroot) to add a --with-sysroot configure argument. I would imagine this belongs in gcc-uclibc-4.x.mk (E.G. the build rules used when using sysroot), but there we already pass --with-sysroot=$(STAGING_DIR) to the final gcc build (the BR2_CONFIGURE_STAGING_SYSROOT variable).

So is this change really needed?

Signature · 1 line
Bye, Peter Korsgaard

A message that is not in the archive (sent off-list or not yet received): [email protected]

#6 lore raw

PATCH 1/1 gcc: Add option to build final-gcc with sysroot option

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Carmelo" == Carmelo AMOROSO <[email protected]> writes:

Hi,

Carmelo> please read the message
Carmelo> http://lists.uclibc.org/pipermail/uclibc/2009-November/043303.html
Carmelo> I've already noted this, so for gcc 4.x.y it is not required, Carmelo> but it should be applied for gcc 3.x.y. What do you think ?

But isn't sysroot a gcc >= 4.1.x feature? Do old gcc's even understand --with-sysroot ?

Signature · 1 line
Bye, Peter Korsgaard