This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [patch][google/integration] Don't force tls-model to initial-exec when building libgomp (issue6107046)
- From: Andrew Pinski <pinskia at gmail dot com>
- To: Paul Pluzhnikov <ppluzhnikov at google dot com>
- Cc: reply at codereview dot appspotmail dot com, gcc-patches at gcc dot gnu dot org
- Date: Sun, 22 Apr 2012 22:09:46 -0700
- Subject: Re: [patch][google/integration] Don't force tls-model to initial-exec when building libgomp (issue6107046)
- References: <20120422175040.224BE190A4E@elbrus2.mtv.corp.google.com>
On Sun, Apr 22, 2012 at 10:50 AM, Paul Pluzhnikov
<ppluzhnikov@google.com> wrote:
> Greetings,
>
> The patch below is needed for google/integration branch:
> we want to be able build libgomp.a with -fPIC, be able to link it into a
> shared library, and be able to dlopen that library without running out of
> static TLS space (-ftls-model=initial-exec precludes that last part).
Do you understand the reason why it was made -ftls-model=initial-exec
in the first place?
IIRC the main reason is because the slow down from not using
initial-exec model for GOMP is a lot.
Thanks,
Andrew Pinski
> Google ref b/6368405
> Google ref b/6156799
>
> Tested: make && make check
>
>
> 2012-04-22 Â Paul Pluzhnikov Â<ppluzhnikov@google.com>
>
> Â Â Â Â* libgomp/configure.tgt: Don't force initial-exec.
>
> Index: libgomp/configure.tgt
> ===================================================================
> --- libgomp/configure.tgt    (revision 186636)
> +++ libgomp/configure.tgt    (working copy)
> @@ -10,16 +10,6 @@
> Â# ÂXCFLAGS Â Â Â Â Â Â Add extra compile flags to use.
> Â# ÂXLDFLAGS Â Â Â Â Â ÂAdd extra link flags to use.
>
> -# Optimize TLS usage by avoiding the overhead of dynamic allocation.
> -if test $gcc_cv_have_tls = yes ; then
> - Âcase "${target}" in
> -
> - Â Â*-*-linux*)
> - Â Â Â XCFLAGS="${XCFLAGS} -ftls-model=initial-exec"
> - Â Â Â ;;
> - Âesac
> -fi
> -
> Â# Since we require POSIX threads, assume a POSIX system by default.
> Âconfig_path="posix"
>
>
> --
> This patch is available for review at http://codereview.appspot.com/6107046