Opened 2 years ago

Closed 4 months ago

#64413 closed defect (fixed)

gdal @3.4.0 +cfitsio+hdf4+hdf5+heif+libkml+lto+lzma+native+netcdf+openjpeg+poppler+postgresql13+proj7+xerces: linker assertion failure

Reported by: cooljeanius (Eric Gallager) Owned by:
Priority: Normal Milestone:
Component: ports Version: 2.7.1
Keywords: Cc: Veence (Vincent)
Port: gdal

Description

Attempting to do sudo port -udc install gdal +cfitsio+hdf4+hdf5+heif+libkml+lto+lzma+native+netcdf+openjpeg+poppler+postgresql13+proj7+xerces with gdal 3.4.0 results in the following error for me:

ld: warning: dylib (/opt/local/lib/libgif.dylib) was built for newer macOS version (11.2) than being linked (11.0)
Assertion failed: ((Record[i] == 5 || Record[i] == 6) && "Invalid attribute group entry"), function parseAttributeGroupBlock, file /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_lang_llvm-10/llvm-10/work/llvm-10.0.1.src/lib/Bitcode/Reader/BitcodeReader.cpp, line 1654.
fatal error: ar: fatal error in /opt/local/bin/ranlib
make[1]: *** [libgdal.la] Error 1
make[1]: Leaving directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_gis_gdal/gdal/work/gdal-3.4.0'
make: *** [check-lib] Error 2
make: Leaving directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_gis_gdal/gdal/work/gdal-3.4.0'
Command failed:  cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_gis_gdal/gdal/work/gdal-3.4.0" && /usr/bin/make -j16 -w 
Exit code: 2
Error: Failed to build gdal: command execution failed
DEBUG: Error code: CHILDSTATUS 19725 2

The full link line is rather long, so instead of including that in what I've pasted here, I'll just upload the full log next.

Attachments (1)

gdal_main.log (4.8 MB) - added by cooljeanius (Eric Gallager) 2 years ago.
main.log for gdal

Change History (9)

Changed 2 years ago by cooljeanius (Eric Gallager)

Attachment: gdal_main.log added

main.log for gdal

comment:1 Changed 2 years ago by Veence (Vincent)

Isn't that a bug in LLVM rather than in GDAL? Does it happen with another version of LLVM/CLANG?

comment:2 in reply to:  1 ; Changed 2 years ago by cooljeanius (Eric Gallager)

Replying to Veence:

Isn't that a bug in LLVM rather than in GDAL? Does it happen with another version of LLVM/CLANG?

I'm not sure how I'd test with another version of LLVM/CLANG? Do you mean by editing the Portfile, or building manually? Or, wait, maybe it picked up the wrong one due to it needing to be UsingTheRightCompiler; let me try rebuilding with trace mode on...

comment:3 Changed 2 years ago by cooljeanius (Eric Gallager)

So yeah building it in trace mode worked; let me find the trace mode warnings...

configure phase:

Warning: The following existing files were hidden from the build system by trace mode:
  /opt/local/bin/ar
  /opt/local/bin/gawk
  /opt/local/bin/ggrep
  /opt/local/bin/gsed
  /opt/local/bin/lipo
  /opt/local/bin/mawk
  /opt/local/bin/nawk
  /opt/local/bin/nf-config
  /opt/local/bin/nm
  /opt/local/bin/nmedit
  /opt/local/bin/otool
  /opt/local/bin/ranlib
  /opt/local/bin/sfcgal-config
  /opt/local/bin/strip
  /opt/local/include/boost
  /opt/local/include/cryptopp/aes.h
  /opt/local/include/cryptopp/osrng.h
  /opt/local/include/libdeflate.h
  /opt/local/lib/libdeflate.a
  /opt/local/lib/libdeflate.dylib
  /opt/local/lib/libunwind.dylib
  /private/var/select/sh
Warning: The following files inside the MacPorts prefix not installed by a port were accessed:
  /opt/local/include/openssl/bio.h
  /opt/local/include/openssl/bioerr.h
  /opt/local/include/openssl/configuration.h
  /opt/local/include/openssl/core.h
  /opt/local/include/openssl/crypto.h
  /opt/local/include/openssl/cryptoerr.h
  /opt/local/include/openssl/cryptoerr_legacy.h
  /opt/local/include/openssl/e_os2.h
  /opt/local/include/openssl/macros.h
  /opt/local/include/openssl/opensslconf.h
  /opt/local/include/openssl/opensslv.h
  /opt/local/include/openssl/safestack.h
  /opt/local/include/openssl/stack.h
  /opt/local/include/openssl/symhacks.h
  /opt/local/include/openssl/types.h
  /opt/local/include/qhull/libqhull.h
  /opt/local/include/qhull/mem.h
  /opt/local/include/qhull/qset.h
  /opt/local/include/qhull/stat.h
  /opt/local/include/qhull/user.h
DEBUG: Executing portconfigure::configure_finish
Warning: Configuration logfiles contain indications of -Wimplicit-function-declaration; check that features were not accidentally disabled:
  mremap: found in gdal-3.4.0/config.log

build phase:

Warning: The following existing files were hidden from the build system by trace mode:
  /opt/local/bin/ar
  /opt/local/bin/git
  /opt/local/bin/ranlib
  /opt/local/include/absl/strings/string_view.h
  /opt/local/lib/libunwind.dylib
  /private/var/select/sh
Warning: The following files inside the MacPorts prefix not installed by a port were accessed:
  /opt/local/include/openssl/asn1.h
  /opt/local/include/openssl/asn1err.h
  /opt/local/include/openssl/async.h
  /opt/local/include/openssl/asyncerr.h
  /opt/local/include/openssl/bio.h
  /opt/local/include/openssl/bioerr.h
  /opt/local/include/openssl/bn.h
  /opt/local/include/openssl/bnerr.h
  /opt/local/include/openssl/buffer.h
  /opt/local/include/openssl/buffererr.h
  /opt/local/include/openssl/comp.h
  /opt/local/include/openssl/comperr.h
  /opt/local/include/openssl/conf.h
  /opt/local/include/openssl/conferr.h
  /opt/local/include/openssl/configuration.h
  /opt/local/include/openssl/conftypes.h
  /opt/local/include/openssl/core.h
  /opt/local/include/openssl/core_dispatch.h
  /opt/local/include/openssl/crypto.h
  /opt/local/include/openssl/cryptoerr.h
  /opt/local/include/openssl/cryptoerr_legacy.h
  /opt/local/include/openssl/ct.h
  /opt/local/include/openssl/cterr.h
  /opt/local/include/openssl/dh.h
  /opt/local/include/openssl/dherr.h
  /opt/local/include/openssl/dsa.h
  /opt/local/include/openssl/dsaerr.h
  /opt/local/include/openssl/dtls1.h
  /opt/local/include/openssl/e_os2.h
  /opt/local/include/openssl/ec.h
  /opt/local/include/openssl/ecerr.h
  /opt/local/include/openssl/engine.h
  /opt/local/include/openssl/engineerr.h
  /opt/local/include/openssl/err.h
  /opt/local/include/openssl/evp.h
  /opt/local/include/openssl/evperr.h
  /opt/local/include/openssl/hmac.h
  /opt/local/include/openssl/http.h
  /opt/local/include/openssl/lhash.h
  /opt/local/include/openssl/macros.h
  /opt/local/include/openssl/obj_mac.h
  /opt/local/include/openssl/objects.h
  /opt/local/include/openssl/objectserr.h
  /opt/local/include/openssl/ocsp.h
  /opt/local/include/openssl/ocsperr.h
  /opt/local/include/openssl/opensslconf.h
  /opt/local/include/openssl/opensslv.h
  /opt/local/include/openssl/params.h
  /opt/local/include/openssl/pem.h
  /opt/local/include/openssl/pemerr.h
  /opt/local/include/openssl/pkcs7.h
  /opt/local/include/openssl/pkcs7err.h
  /opt/local/include/openssl/prov_ssl.h
  /opt/local/include/openssl/rand.h
  /opt/local/include/openssl/randerr.h
  /opt/local/include/openssl/rsa.h
  /opt/local/include/openssl/rsaerr.h
  /opt/local/include/openssl/safestack.h
  /opt/local/include/openssl/sha.h
  /opt/local/include/openssl/srtp.h
  /opt/local/include/openssl/ssl.h
  /opt/local/include/openssl/ssl2.h
  /opt/local/include/openssl/ssl3.h
  /opt/local/include/openssl/sslerr.h
  /opt/local/include/openssl/sslerr_legacy.h
  /opt/local/include/openssl/stack.h
  /opt/local/include/openssl/symhacks.h
  /opt/local/include/openssl/tls1.h
  /opt/local/include/openssl/types.h
  /opt/local/include/openssl/ui.h
  /opt/local/include/openssl/uierr.h
  /opt/local/include/openssl/x509.h
  /opt/local/include/openssl/x509_vfy.h
  /opt/local/include/openssl/x509err.h
  /opt/local/include/openssl/x509v3.h
  /opt/local/include/openssl/x509v3err.h

destroot phase:

Warning: The following existing files were hidden from the build system by trace mode:
  /opt/local/bin/git
  /opt/local/bin/ranlib
  /private/var/select/sh
  /var/root/.CFUserTextEncoding

I'm not seeing anything related to clang/llvm or compiling/linking, though? So I don't know what exactly trace mode fixed...

comment:4 Changed 2 years ago by Veence (Vincent)

I wasn't especially thinking about the trace mode, but I’m pretty sure the error you got is due to a bug in that old version of llvm. It seems you use a ‘Macports’ installed LLVM to compile GDAL, don’t you?

comment:5 Changed 2 years ago by cooljeanius (Eric Gallager)

the port may very well be using a Macports-installed LLVM to compile, but it *shouldn't* be, it should be UsingTheRightCompiler instead

comment:6 in reply to:  2 ; Changed 2 years ago by evanmiller (Evan Miller)

Replying to cooljeanius:

I'm not sure how I'd test with another version of LLVM/CLANG? Do you mean by editing the Portfile, or building manually? Or, wait, maybe it picked up the wrong one due to it needing to be UsingTheRightCompiler; let me try rebuilding with trace mode on...

You can set the compiler on the command line by adding configure.compiler to the end of the port command:

port clean gdal
port build gdal configure.compiler=macports-gcc-11

You can set most Portfile variables in this way. Very handy for testing small changes!

comment:7 in reply to:  6 Changed 2 years ago by cooljeanius (Eric Gallager)

Replying to evanmiller:

Replying to cooljeanius:

I'm not sure how I'd test with another version of LLVM/CLANG? Do you mean by editing the Portfile, or building manually? Or, wait, maybe it picked up the wrong one due to it needing to be UsingTheRightCompiler; let me try rebuilding with trace mode on...

You can set the compiler on the command line by adding configure.compiler to the end of the port command:

I thought we weren't supposed to do that, though. And in any case, if the issue is that it isn't UsingTheRightCompiler, I don't see how that would help?

comment:8 Changed 4 months ago by Schamschula (Marius Schamschula)

Resolution: fixed
Status: newclosed
Note: See TracTickets for help on using tickets.