Re: pltcl crash on recent macOS - Mailing list pgsql-hackers

From Peter Eisentraut
Subject Re: pltcl crash on recent macOS
Date
Msg-id 306a3b45-713d-9503-6c1a-3a92d79f5361@enterprisedb.com
Whole thread Raw
In response to Re: pltcl crash on recent macOS  (Thomas Munro <thomas.munro@gmail.com>)
List pgsql-hackers
On 13.06.22 23:32, Thomas Munro wrote:
> Hrmph, I changed my CC to "ccache gcc-mp-11" (what MacPorts calls GCC
> 11), and I still can't reproduce the problem.  I still get "(from
> executable)".  In your original quote you showed "gcc", not "gcc-11",
> which (assuming it is found as /usr/bin/gcc) is just a little binary
> that redirects to clang... trying that, this time without ccache in
> the mix... and still no cigar.  So something is different about GCC 11
> from homebrew, or the linker invocation it produces under the covers,
> or the linker it's using?

The original quote said "gcc" but that just me attempting to simplify. 
I have now also figured out that it works with gcc-10 but not with 
gcc-11 and gcc-12.  For example, below are the underlying linker 
invocations from gcc-10 and gcc-11.  Note that some of the options are 
ordered quite differently.  I don't know what all of that means yet, but 
it surely points to something in gcc or its packaging being the cause.

However, I think ultimately the use of -lc is an error and we should get 
rid of it.  This episode shows that it's very fragile in any case.


 
"/usr/local/Cellar/gcc@10/10.3.0/libexec/gcc/x86_64-apple-darwin20/10.3.0/collect2" 
-dynamic -arch x86_64 -bundle -bundle_loader 
../../../src/backend/postgres -macosx_version_min 11.4.0 
-multiply_defined suppress -syslibroot 
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk 
-weak_reference_mismatches non-weak -o pltcl.so -L../../../src/port 
-L../../../src/common -L/usr/local/lib -L/usr/local/opt/openldap/lib 
"-L/usr/local/opt/openssl@1.1/lib" -L/usr/local/opt/readline/lib 
-L/usr/local/opt/krb5/lib -L/usr/local/opt/icu4c/lib 
-L/usr/local/opt/tcl-tk/lib -L/usr/local/Cellar/libxml2/2.9.14/lib 
-L/usr/local/Cellar/lz4/1.9.3/lib -L/usr/local/Cellar/zstd/1.5.2/lib 
-L/usr/local/Cellar/tcl-tk/8.6.12_1/lib 
"-L/usr/local/Cellar/gcc@10/10.3.0/lib/gcc/10/gcc/x86_64-apple-darwin20/10.3.0" 
"-L/usr/local/Cellar/gcc@10/10.3.0/lib/gcc/10/gcc/x86_64-apple-darwin20/10.3.0/../../.." 
pltcl.o -dead_strip_dylibs -ltcl8.6 -lz -framework CoreFoundation -lc 
-lSystem -lgcc_ext.10.5 -lgcc -lSystem -no_compact_unwind -idsym

 
/usr/local/Cellar/gcc/11.3.0_1/bin/../libexec/gcc/x86_64-apple-darwin21/11/collect2 
-dynamic -arch x86_64 -syslibroot 
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk 
-macosx_version_min 12.4.0 -o pltcl.so -L../../../src/port 
-L../../../src/common -L/usr/local/lib -L/usr/local/opt/openldap/lib 
"-L/usr/local/opt/openssl@1.1/lib" -L/usr/local/opt/readline/lib 
-L/usr/local/opt/krb5/lib -L/usr/local/opt/icu4c/lib 
-L/usr/local/opt/tcl-tk/lib -L/usr/local/Cellar/libxml2/2.9.14/lib 
-L/usr/local/Cellar/lz4/1.9.3/lib -L/usr/local/Cellar/zstd/1.5.2/lib 
-L/usr/local/Cellar/tcl-tk/8.6.12_1/lib 
-L/usr/local/Cellar/gcc/11.3.0_1/bin/../lib/gcc/11/gcc/x86_64-apple-darwin21/11 
-L/usr/local/Cellar/gcc/11.3.0_1/bin/../lib/gcc/11/gcc 
-L/usr/local/Cellar/gcc/11.3.0_1/bin/../lib/gcc/11/gcc/x86_64-apple-darwin21/11/../../.. 
pltcl.o -dead_strip_dylibs -ltcl8.6 -lz -lc -bundle_loader 
../../../src/backend/postgres -bundle -framework CoreFoundation 
-multiply_defined suppress -lemutls_w -lgcc -lSystem -no_compact_unwind 
-idsym



pgsql-hackers by date:

Previous
From: Peter Geoghegan
Date:
Subject: Re: better page-level checksums
Next
From: Peter Geoghegan
Date:
Subject: Re: better page-level checksums