On 15/08/2013, at 10:49 PM, Alexander Ivchenko wrote:

> Could anybody please take a look? This is important for building gcc for 
> android.
> 
> ping^4

[Sorry for being cranky]

There is a reason why people are ignoring your patch -- the submission is not 
very well structured.

First, the subject -- it is not accurate.  "Redesign" implies a big change, you 
would be better off with a heading like "Fix LIB_SPEC for Android".

Second, you do not fully describe the problem that you are trying to fix.

Third, you do not say how your patch fixes the problem.

Lastly, you do not mention which targets you have encountered the problem on 
and tested the fix on.  Since you are from Intel, I can guess that you use x86.


> >>>> 2013-04-02  Pavel Chupin  <pavel.v.chu...@intel.com>
> >>>>
> >>>>         Redesign pthread in LIB_SPEC for systems without libpthread
> >>>>         * gcc/config/gnu-user.h: Remove pthread from 
> >>>> GNU_USER_TARGET_LIB_SPEC
> >>>>         but keep in default LIB_SPEC
> >>>>         * gcc/config/linux-android.h: Add pthread to ANDROID_LIB_SPEC
> >>>>
> >>>> Is it OK for trunk?


> --- a/gcc/config/gnu-user.h
> +++ b/gcc/config/gnu-user.h
> @@ -74,11 +74,10 @@ see the files COPYING3 and COPYING.RUNTIME respectively.  
> If not, see
>  #define CPLUSPLUS_CPP_SPEC "-D_GNU_SOURCE %(cpp)"
>  
>  #define GNU_USER_TARGET_LIB_SPEC \
> -  "%{pthread:-lpthread} \
> -   %{shared:-lc} \
> +   "%{shared:-lc} \

Indentation seems off here, please double-check.

>     %{!shared:%{mieee-fp:-lieee} %{profile:-lc_p}%{!profile:-lc}}"
>  #undef  LIB_SPEC
> -#define LIB_SPEC GNU_USER_TARGET_LIB_SPEC
> +#define LIB_SPEC "%{pthread:-lpthread} " GNU_USER_TARGET_LIB_SPEC

You need to similarly add "%{pthread:-lpthread} " to LIB_SPEC in 
gcc/config/mips/gnu-user.h.

>  
>  #if defined(HAVE_LD_EH_FRAME_HDR)
>  #define LINK_EH_SPEC "%{!static:--eh-frame-hdr} "
> diff --git a/gcc/config/linux-android.h b/gcc/config/linux-android.h
> index 831a19c..aaf1d34 100644
> --- a/gcc/config/linux-android.h
> +++ b/gcc/config/linux-android.h
> @@ -49,7 +49,8 @@
>    "%{!frtti:%{!fno-rtti: -fno-rtti}}"
>  
>  #define ANDROID_LIB_SPEC \
> -  "%{!static: -ldl}"
> +  "%{!static: -ldl}" \
> +  "%{pthread: -lc}"

Add a comment to explain why -pthread option triggers -lc for Android.

Please post the updated patch along with notes on which targets you have tested 
it.  Test coverage should include at least x86_64-linux-gnu and one of android 
targets.

Thank you,

--
Maxim Kuvyrkov
www.kugelworks.com


Reply via email to