From: Iain Sandoe <iain@sandoe.co.uk>
To: GCC Patches <GCC-patches@gcc.gnu.org>, libstdc++ <libstdc++@gcc.gnu.org>
Cc: Jeff Law <law@redhat.com>
Subject: Re: [PATCH 1, 2] Darwin : Update libtool and dependencies for Darwin20 [PR97865]
Date: Wed, 2 Dec 2020 16:11:24 +0000 [thread overview]
Message-ID: <8739298D-11AD-473A-A881-56A9DAAC9561@sandoe.co.uk> (raw)
In-Reply-To: <20201124104735.GB1312820@redhat.com>
given that this is a blocker for Darwin20 and is Darwin-local I plan to
apply it (with the spello fixes) if there are no more comments in the next
24h.
thanks
Iain
Jonathan Wakely <jwakely@redhat.com> wrote:
> On 23/11/20 20:01 +0000, Iain Sandoe wrote:
>> Hi
>>
>> This fixes a blocker for x86_64 darwin20 (a.k.a macOS 11)
>> It is needed on all open branches too.
>>
>> (probably this comes under my Dariwn hat - but since it involves
>> regenerating all the configure scripts… I’d welcome another pair
>> of eyes)
>>
>> tested on:
>> darwin8-darwin20, powerpc, i686, x86_64, arm64(aarch64).
>> aix (cfarm gcc119), aarch64 (cfarm gcc115), powerpc64 (BE) - (cfarm
>> gcc110)
>> powerpc64 (LE) - (cfarm gcc135), sparc solaris 2.11 (gcc211)
>> x86_64-linux-gnu (cfarm gcc123)
>>
>> OK for master?
>>
>> OK for backports?
>>
>> thanks
>> iain
>>
>> N.B. I am attaching the second patch which is the uninteresting
>> regenerated files.
>>
>> =====
>>
>> The change in major version (and the increment from Darwin19 to 20)
>> caused libtool tests to fail which resulted in incorrect build settings
>> for shared libraries.
>>
>> We take this opportunity to sort out the shared undefined symbols state
>> rather than propagating the current unsound behaviour into a new rev.
>>
>> This change means that we default to the case that missing symbols are
>> considered an error, and if one wants to allow this intentionally, the
>> confiuration for that case should be set appropriately.
>>
>> We use intentional missing symbols to emulate the ELF behaviour when
>> we have a weak undefined extern.
>>
>> So, three existing cases need undefined dynamic lookup:
>> libitm, where there is already a configuration mechanism to add the
>> flags.
>> libsanitizer, likewise
>> libcc1, where we add simple configuration to add the flags for Darwin.
>>
>> libcc1/ChangeLog:
>>
>> PR target/97865
>> * Makefile.am: Add dynamic_lookup to LD flags for Darwin.
>> * configure.ac: Test for Darwin host and set a flag.
>>
>> libitm/ChangeLog:
>>
>> PR target/97865
>> * configure.tgt: Add dynamic_lookup to XLDFLAGS for Darwin.
>>
>> libsanitizer/ChangeLog:
>>
>> PR target/97865
>> * configure.tgt: Add dynamic_lookup to EXTRA_CXXFLAGS for
>> Darwin.
>>
>> ChangeLog:
>>
>> PR target/97865
>> * libtool.m4: Update handling of Darwin platform link flags
>> for Darwin20.
>>
>>
>> ---
>> libcc1/Makefile.am | 3 +++
>> libcc1/configure.ac | 6 ++++++
>> libitm/configure.tgt | 9 ++++++++-
>> libsanitizer/configure.tgt | 1 +
>> libtool.m4 | 32 +++++++++++++++++---------------
>> 5 files changed, 35 insertions(+), 16 deletions(-)
>>
>> diff --git a/libcc1/Makefile.am b/libcc1/Makefile.am
>> index ab6f839ecae..173b84f9cdb 100644
>> --- a/libcc1/Makefile.am
>> +++ b/libcc1/Makefile.am
>> @@ -25,6 +25,9 @@ CPPFLAGS_FOR_C_FAMILY = -I $(srcdir)/../gcc/c-family \
>> CPPFLAGS_FOR_C = $(CPPFLAGS_FOR_C_FAMILY) -I $(srcdir)/../gcc/c
>> CPPFLAGS_FOR_CXX = $(CPPFLAGS_FOR_C_FAMILY) -I $(srcdir)/../gcc/cp
>> AM_CXXFLAGS = $(WARN_FLAGS) $(WERROR) $(visibility) $(CET_HOST_FLAGS)
>> +if DARWIN_DYNAMIC_LOOKUP
>> +AM_CXXFLAGS += -Wl,-undefined,dynamic_lookup
>> +endif
>> override CXXFLAGS := $(filter-out -fsanitize=address,$(CXXFLAGS))
>> override LDFLAGS := $(filter-out -fsanitize=address,$(LDFLAGS))
>> # Can be simplified when libiberty becomes a normal convenience library.
>> diff --git a/libcc1/configure.ac b/libcc1/configure.ac
>> index 8d3b8d14748..262e0a61e6f 100644
>> --- a/libcc1/configure.ac
>> +++ b/libcc1/configure.ac
>> @@ -104,6 +104,12 @@ AC_CACHE_CHECK([for socket libraries],
>> libcc1_cv_lib_sockets,
>> ])
>> LIBS="$LIBS $libcc1_cv_lib_sockets"
>>
>> +case "$host" in
>> + *-*-darwin*) darwin_dynamic_lookup=yes ;;
>> + *) darwin_dynamic_lookup= ;;
>> +esac
>> +AM_CONDITIONAL(DARWIN_DYNAMIC_LOOKUP, test $darwin_dynamic_lookup = yes)
>> +
>> # If any of these functions are missing, simply don't bother building
>> # this plugin.
>> GCC_ENABLE_PLUGINS
>> diff --git a/libitm/configure.tgt b/libitm/configure.tgt
>> index 04109160e91..d1beb5c9ec8 100644
>> --- a/libitm/configure.tgt
>> +++ b/libitm/configure.tgt
>> @@ -43,6 +43,7 @@ if test "$gcc_cv_have_tls" = yes ; then
>> *-*-linux*)
>> XCFLAGS="${XCFLAGS} -ftls-model=initial-exec"
>> ;;
>> +
>> esac
>> fi
>>
>> @@ -144,10 +145,16 @@ case "${target}" in
>> *-*-gnu* | *-*-k*bsd*-gnu \
>> | *-*-netbsd* | *-*-freebsd* | *-*-openbsd* \
>> | *-*-solaris2* | *-*-sysv4* | *-*-hpux11* \
>> - | *-*-darwin* | *-*-aix* | *-*-dragonfly*)
>> + | *-*-aix* | *-*-dragonfly*)
>> # POSIX system. The OS is supported.
>> ;;
>>
>> + *-*-darwin*)
>> + # The OS is supported, but we need dynamic lookup to support undefined
>> + # weak symbols at link-time.
>> + XLDFLAGS="${XLDFLAGS} -Wl,-undefined,dynamic_lookup"
>> + ;;
>> +
>> *) # Non-POSIX, or embedded system
>> UNSUPPORTED=1
>> ;;
>> diff --git a/libsanitizer/configure.tgt b/libsanitizer/configure.tgt
>> index ef9150209c4..f73d410dedf 100644
>> --- a/libsanitizer/configure.tgt
>> +++ b/libsanitizer/configure.tgt
>> @@ -64,6 +64,7 @@ case "${target}" in
>> ;;
>> x86_64-*-darwin2* | x86_64-*-darwin1[2-9]* | i?86-*-darwin1[2-9]*)
>> TSAN_SUPPORTED=no
>> + EXTRA_CXXFLAGS+="-Wl,-undefined,dynamic_lookup"
>> ;;
>> x86_64-*-solaris2.11* | i?86-*-solaris2.11*)
>> ;;
>> diff --git a/libtool.m4 b/libtool.m4
>> index e194e899fcf..9b14b9470df 100644
>> --- a/libtool.m4
>> +++ b/libtool.m4
>> @@ -994,23 +994,25 @@ _LT_EOF
>> rm -f conftest.err libconftest.a conftest conftest.c
>> rm -rf conftest.dSYM
>> ])
>> - case $host_os in
>> - rhapsody* | darwin1.[[012]])
>> + # Allow for Darwin 4-7 (macOS 10.0-10.3) although these are not
>> expect to
>> + # build without first building modern cctools / linker.
>> + case $host_cpu-$host_os in
>> + *-rhapsody* | *-darwin1.[[012]])
>> _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;;
>> - darwin1.*)
>> + *-darwin1.*)
>> _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
>> - darwin*) # darwin 5.x on
>> - # if running on 10.5 or later, the deployment target defaults
>> - # to the OS version, if on x86, and 10.4, the deployment
>> - # target defaults to 10.4. Don't you love it?
>> - case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in
>> - 10.0,*86*-darwin8*|10.0,*-darwin[[91]]*)
>> - _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
>> + *-darwin*)
>> + # darwin 5.x (macoS 10.5) onwards we only adjust when the
>> deployement
>
> Typos "macoS" and "deployement".
>
> Apart from that, I have no comment on it because darwin versioning
> twists my melon.
>
> The regenerated configure for libstdc++ is OK.
prev parent reply other threads:[~2020-12-02 16:11 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-11-23 20:01 [PATCH 1,2] " Iain Sandoe
2020-11-24 10:47 ` Jonathan Wakely
2020-12-02 16:11 ` Iain Sandoe [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=8739298D-11AD-473A-A881-56A9DAAC9561@sandoe.co.uk \
--to=iain@sandoe.co.uk \
--cc=GCC-patches@gcc.gnu.org \
--cc=law@redhat.com \
--cc=libstdc++@gcc.gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).