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] Redesign pthread in LIB_SPEC for systems without libpthread


> 1. In config/gnu-user.h you define GNU_USER_TARGET_NO_PTHREADS_LIB_SPEC to the main part of GNU_USER_TARGET_LIB_SPEC.  GNU_USER_TARGET_LIB_SPEC now becomes '"%{pthread:-lpthread} " GNU_USER_TARGET_NO_PTHREADS_LIB_SPEC'.
> 2. In occurrences of LINUX_OR_ANDROID_LD you continue to use GNU_USER_TARGET_LIB_SPEC for the first argument and 'GNU_USER_TARGET_NO_PTHREADS_LIB_SPEC " " ANDROID_LIB_SPEC'  for the second argument.
>
> This way you are operating with named macros instead of verbatim "%{pthread:-lpthread}", and, hopefully, this will be more clear to an outside observer.
>

Done.

>>
>> Please see modified patch attached.
>> I've built all 3 Android compilers, x86_64 and i686 and ran simple
>> test with -pthread.
>
> Thanks for good test coverage.  I assume you have also tested a non-android Linux target?

Yes. By x86_64 and i686 above I meant Linux non-android target. And I
built successfully all 3 Android compilers.

>
> The patch is OK if adjusted to the comments above (or good arguments provided why your current patch is more straigh-forward).
>

Thanks. I'm OK with your suggestions.
Please see adjusted patch attached.

Updated ChangeLog:

2013-08-19  Pavel Chupin  <pavel.v.chupin@intel.com>

        Fix LIB_SPEC for systems without libpthread
        * config/gnu-user.h: Introduce GNU_USER_TARGET_NO_PTHREADS_LIB_SPEC.
        * config/arm/linux-eabi.h: Use GNU_USER_TARGET_NO_PTHREADS_LIB_SPEC
        for Android.
        * config/i386/linux-common.h: Likewise.
        * config/mips/linux-common.h: Likewise.

-- 
Pavel Chupin
Intel Corporation

Attachment: 0001-Fix-LIB_SPEC-for-systems-without-libpthread.patch
Description: Binary data


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