#66084 closed defect (fixed)

icoutils @0.32.3_1: build failure on Ventura. archive member 'libgnu.a' with length 49080 is not mach-o or llvm bitcode file

Reported by: kencu (Ken) Owned by: kencu (Ken)
Priority: Normal Milestone:
Component: ports Version:
Keywords: ventura Cc:
Port: icoutils

Description

/usr/bin/clang -fno-common -W -Wabi -Waddress -Waggressive-loop-optimizations -Wall -Wattributes -Wbad-function-cast -Wbool-compare -Wbool-operation -Wbuiltin-declaration-mismatch -Wbuiltin-macro-redefined -Wcast-align -Wchar-subscripts -Wchkp -Wclobbered -Wcomment -Wcomments -Wcoverage-mismatch -Wcpp -Wdangling-else -Wdate-time -Wdeprecated -Wdeprecated-declarations -Wdesignated-init -Wdisabled-optimization -Wdiscarded-array-qualifiers -Wdiscarded-qualifiers -Wdiv-by-zero -Wdouble-promotion -Wduplicated-branches -Wduplicated-cond -Wduplicate-decl-specifier -Wempty-body -Wendif-labels -Wenum-compare -Wexpansion-to-defined -Wextra -Wformat-contains-nul -Wformat-extra-args -Wformat-nonliteral -Wformat-security -Wformat-signedness -Wformat-y2k -Wformat-zero-length -Wframe-address -Wfree-nonheap-object -Whsa -Wignored-attributes -Wignored-qualifiers -Wimplicit -Wimplicit-function-declaration -Wimplicit-int -Wincompatible-pointer-types -Winit-self -Winline -Wint-conversion -Wint-in-bool-context -Wint-to-pointer-cast -Winvalid-memory-model -Winvalid-pch -Wjump-misses-init -Wlogical-not-parentheses -Wlogical-op -Wmain -Wmaybe-uninitialized -Wmemset-elt-size -Wmemset-transposed-args -Wmisleading-indentation -Wmissing-braces -Wmissing-field-initializers -Wmissing-include-dirs -Wmissing-parameter-type -Wmultichar -Wnarrowing -Wnested-externs -Wnonnull -Wnonnull-compare -Wnull-dereference -Wodr -Wold-style-declaration -Wold-style-definition -Wopenmp-simd -Woverflow -Woverlength-strings -Woverride-init -Wpacked-bitfield-compat -Wparentheses -Wpointer-arith -Wpointer-compare -Wpointer-sign -Wpointer-to-int-cast -Wpragmas -Wpsabi -Wrestrict -Wreturn-local-addr -Wreturn-type -Wscalar-storage-order -Wsequence-point -Wshadow -Wshift-count-negative -Wshift-count-overflow -Wshift-negative-value -Wsizeof-array-argument -Wsizeof-pointer-memaccess -Wstack-protector -Wstrict-aliasing -Wstrict-overflow -Wsuggest-attribute=noreturn -Wsuggest-final-methods -Wsuggest-final-types -Wswitch -Wswitch-bool -Wswitch-unreachable -Wsync-nand -Wsystem-headers -Wtautological-compare -Wtrampolines -Wtrigraphs -Wtype-limits -Wuninitialized -Wunknown-pragmas -Wunsafe-loop-optimizations -Wunused -Wunused-but-set-parameter -Wunused-but-set-variable -Wunused-function -Wunused-label -Wunused-local-typedefs -Wunused-parameter -Wunused-result -Wunused-value -Wunused-variable -Wvarargs -Wvariadic-macros -Wvector-operation-performance -Wvolatile-register-var -Wwrite-strings -Walloc-size-larger-than=9223372036854775807 -Warray-bounds=2 -Wformat-overflow=2 -Wformat-truncation=2 -Wimplicit-fallthrough=5 -Wnormalized=nfc -Wshift-overflow=2 -Wstringop-overflow=2 -Wunused-const-variable=2 -Wvla-larger-than=4031 -Wno-unused-parameter  -pipe -Os -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX13.sdk -arch x86_64  -L/opt/local/lib -Wl,-headerpad_max_install_names -Wl,-syslibroot,/Library/Developer/CommandLineTools/SDKs/MacOSX13.sdk -arch x86_64 -o icotool create.o extract.o main.o palette.o win32-endian.o -lpng -lz -lm ../common/libcommon.a ../lib/libgnu.a -lintl -Wl,-framework -Wl,CoreFoundation 
ld: in ../common/libcommon.a(libgnu.a), archive member 'libgnu.a' with length 49080 is not mach-o or llvm bitcode file '../common/libcommon.a' for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [icotool] Error 1
% file ./lib/libgnu.a
./lib/libgnu.a: current ar archive random library

% lipo -info ./lib/libgnu.a
Non-fat file: ./lib/libgnu.a is architecture: x86_64

% file ./common/libcommon.a
./common/libcommon.a: current ar archive random library

% lipo -info ./common/libcommon.a
Non-fat file: ./common/libcommon.a is architecture: x86_64

Attachments (2)

icoutils-ventura-intel-fail-less-noisy.log (310.4 KB) - added by kencu (Ken) 18 months ago.
icoutils-ventura-intel-fail.log (1.6 MB) - added by kencu (Ken) 18 months ago.

Download all attachments as: .zip

Change History (10)

Changed 18 months ago by kencu (Ken)

Changed 18 months ago by kencu (Ken)

comment:1 Changed 18 months ago by kencu (Ken)

The less noisy log is after adding this to the portfile:

configure.cppflags-append -Wno-nullability-completeness

comment:2 Changed 18 months ago by kencu (Ken)

trying with clang-14 fails too. Here's a more detailed look at what happens with this failing link:

 % /opt/local/bin/clang-mp-14 -fno-common -pipe -Os -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX13.sdk -arch x86_64  -L/opt/local/lib -Wl,-headerpad_max_install_names -Wl,-syslibroot,/Library/Developer/CommandLineTools/SDKs/MacOSX13.sdk -arch x86_64 -o icotool create.o extract.o main.o palette.o win32-endian.o -lpng -lz -lm ../common/libcommon.a ../lib/libgnu.a -lintl -Wl,-framework -Wl,CoreFoundation -Wl,-v -v
clang version 14.0.6
Target: x86_64-apple-darwin22.1.0
Thread model: posix
InstalledDir: /opt/local/libexec/llvm-14/bin
 "/opt/local/libexec/llvm-14/bin/ld" -demangle -lto_library /opt/local/libexec/llvm-14/lib/libLTO.dylib -dynamic -arch x86_64 -platform_version macos 13.0.0 13.0 -syslibroot /Library/Developer/CommandLineTools/SDKs/MacOSX13.sdk -o icotool -L/opt/local/lib -headerpad_max_install_names -syslibroot /Library/Developer/CommandLineTools/SDKs/MacOSX13.sdk create.o extract.o main.o palette.o win32-endian.o -lpng -lz -lm ../common/libcommon.a ../lib/libgnu.a -lintl -framework CoreFoundation -v -lSystem /opt/local/libexec/llvm-14/lib/clang/14.0.6/lib/darwin/libclang_rt.osx.a
@(#)PROGRAM:ld  PROJECT:ld64-820.1
BUILD 18:42:34 Sep 11 2022
configured to support archs: armv6 armv7 armv7s arm64 arm64e arm64_32 i386 x86_64 x86_64h armv6m armv7k armv7m armv7em
Library search paths:
	/opt/local/lib
	/Library/Developer/CommandLineTools/SDKs/MacOSX13.sdk/usr/lib
	/Library/Developer/CommandLineTools/SDKs/MacOSX13.sdk/usr/lib
Framework search paths:
	/Library/Frameworks/
	/Library/Developer/CommandLineTools/SDKs/MacOSX13.sdk/System/Library/Frameworks/
	/Library/Developer/CommandLineTools/SDKs/MacOSX13.sdk/System/Library/Frameworks/
ld: in ../common/libcommon.a(libgnu.a), archive member 'libgnu.a' with length 49168 is not mach-o or llvm bitcode file '../common/libcommon.a' for architecture x86_64

some kind of LTO error?

comment:3 Changed 18 months ago by kencu (Ken)

For the moment, I just installed the binary from darwin21, using some thwackery that I know I am not supposed to explain to folks -- and that works for me until this gets fixed.

comment:4 Changed 18 months ago by jmroot (Joshua Root)

Is this one of those things that combines multiple static archives into one, without excluding __.SYMDEF* files, thus ending up with several of them in the new archive?

Last edited 18 months ago by jmroot (Joshua Root) (previous) (diff)

comment:6 in reply to:  4 Changed 18 months ago by kencu (Ken)

Replying to jmroot:

Is this one of those things that combines multiple static archives into one, without excluding __.SYMDEF* files, thus ending up with several of them in the new archive?

looks like something to look into, for sure.

comment:7 Changed 18 months ago by kencu (Ken)

I think the linker doesn't handle one entire archive being embedded into another:

ar cr libcommon.a error.o hmap.o io-utils.o intutil.o llist.o strbuf.o string-utils.o tmap.o ../lib/libgnu.a

comment:8 Changed 18 months ago by kencu (Ken)

Owner: set to kencu
Resolution: fixed
Status: newclosed

In b18a52f7dcc119c3988503fd044c508f4197dbab/macports-ports (master):

icoutils: fix build with Ventura (at least)

the linker does not appear to accept one static archive
being wholly embedded into another.

in this case, embedding libgnu.a into libcommon.a was
unnecessary anyway, as the two libraries are always included
individually when linked in.

closes: #66084

Note: See TracTickets for help on using tickets.