This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: PATCH: Check TLS for libgcc



Luckily, we can use GCC_CHECK_TLS for the native compiler of the
native target.  Even if the build compiler doesn't support TLS, it
won't be a problem.  The stage 2 and stage 3 libgcc will have proper
TLS support if the stage 2 and stage 3 compilers do supprot TLS at
run-time. During stage 3, the compiler checked by GCC_CHECK_TLS in
gcc in this case is the stage 2 compiler, which should have the
identical features as the stage 3 compiler, which will be used to
compile stage 3 libgcc. So libgcc can use auto-host.h in gcc to check
if TLS can be used for the native compiler of the native target.

My first choice would be to try wrapping the invocation in libgcc like this:


  if test $host = $build; then
    saved_CFLAGS=$CFLAGS saved_CC=$CC
    CC=$CC_FOR_BUILD CFLAGS=$CFLAGS_FOR_BUILD
  fi
  GCC_CHECK_TLS
  if test $host = $build; then
    CFLAGS=$saved_CFLAGS
    CC=$saved_CC
  fi

It should use the previous stage of as/ld/gcc instead of the current stage. However, this is not true right now because CC_FOR_BUILD is not modified correctly. I'll see if I can make a patch.

Paolo


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]