LinearTapeFileSystem / ltfs

Reference implementation of the LTFS format Spec for stand alone tape drive
BSD 3-Clause "New" or "Revised" License
255 stars 76 forks source link

Unable to build anymore on MacOS 14 on Apple Silicon #430

Closed krim404 closed 1 year ago

krim404 commented 1 year ago

The current repository is not buildable anymore on MacOS 14 Sonoma with an Apple Silicon (ARM) CPU.

The build process somehow tries to build X86 binaries and then aborts with architecture error.

libtool: link: gcc -dynamiclib -Wl,-undefined -Wl,dynamic_lookup -o .libs/libltfs.0.dylib  .libs/libltfs_la-ltfs.o .libs/libltfs_la-ltfs_internal.o .libs/libltfs_la-ltfs_fsops.o .libs/libltfs_la-ltfs_fsops_raw.o .libs/libltfs_la-ltfssnmp.o .libs/libltfs_la-fs.o .libs/libltfs_la-xml_common.o .libs/libltfs_la-xml_writer.o .libs/libltfs_la-xml_reader.o .libs/libltfs_la-xml_writer_libltfs.o .libs/libltfs_la-xml_reader_libltfs.o .libs/libltfs_la-label.o .libs/libltfs_la-base64.o .libs/libltfs_la-tape.o .libs/libltfs_la-iosched.o .libs/libltfs_la-dcache.o .libs/libltfs_la-kmi.o .libs/libltfs_la-pathname.o .libs/libltfs_la-index_criteria.o .libs/libltfs_la-xattr.o .libs/libltfs_la-ltfslogging.o .libs/libltfs_la-ltfstrace.o .libs/libltfs_la-ltfs_thread.o .libs/libltfs_la-config_file.o .libs/libltfs_la-plugin.o .libs/libltfs_la-periodic_sync.o arch/.libs/libltfs_la-uuid_internal.o arch/.libs/libltfs_la-filename_handling.o arch/.libs/libltfs_la-time_internal.o arch/.libs/libltfs_la-arch_info.o arch/.libs/libltfs_la-errormap.o   -L/opt/local/lib -lfuse -L/opt/homebrew/Cellar/ossp-uuid/1.6.2_2/lib -luuid -lxml2 -L/usr/local/Cellar/icu4c/70.1/lib -licui18n -licuuc -licudata ../../messages/liblibltfs_dat.a ../../messages/libinternal_error_dat.a ../../messages/libtape_common_dat.a -framework CoreFoundation -framework IOKit -lpthread  -g -O2 -O0 -ggdb   -pthread -framework CoreFoundation -framework IOKit -install_name  /usr/local/lib/libltfs.0.dylib -compatibility_version 1 -current_version 1.0 
ld: warning: ignoring file '/Users/krim/GIT/ltfs/messages/liblibltfs_dat.a': found architecture 'x86_64', required architecture 'arm64'
piste-jp commented 1 year ago

It looks this is the dup of #246.

krim404 commented 1 year ago

nope, it worked a few releases earlier without a problem (on MacOS 13), also its not an icu4c error, as the build error is in liblibltfs_dat.

piste-jp commented 1 year ago

as the build error is in liblibltfs_dat.

I don't think so. See the message,

ld: warning: ignoring file '/Users/krim/GIT/ltfs/messages/liblibltfs_dat.a': found architecture 'x86_64', required architecture 'arm64'

The build error happened while linking the objects. And it said the object liblibltfs_dat.a has wrong architecture. I believe liblibltfs_dat.a is successfully generated by ICU.

I'm not sure what you were done from previous env to current env. But I guess you update the ICU by homebrew. But it might provide x86 binary (assume run with rosetta) because MacOS 14 is really new OS.

krim404 commented 1 year ago

i checked the libicu files on my system (and reinstalled them multiple times, just to make sure), they are (for example) libicudata.73.2.dylib: Mach-O 64-bit dynamically linked shared library arm64 so pretty sure it is not libicu. :-( Sadly i dont see which libraries are used in the creation of the libibltfs_dat.a, it is possible that brew has something to do with it.

piste-jp commented 1 year ago

Hmm

Let's see https://github.com/LinearTapeFileSystem/ltfs/blob/18ae70c3caae96caad687c18f763b719c3c0c31e/messages/make_message_src.sh#L6-L18

Did you install ICU package provided from IBM or other vendors? It looks if it is installed, it might be used. The package provided from vendors are compiled for x86_64, so generated object by genrb command is for x86_64.

krim404 commented 1 year ago

the ICU.framework is indeed existing and its an intel binary, even on my pure Apple Silicon machine. I have no clue how the configure script is working, but shouldnt this use the files of (for ex. on my build): /opt/homebrew/Cellar/icu4c/73.2 with higher priority?

however, just deleted the framework - now i can compile again. i have indeed installed IBMs ITDT-ge a few month ago, but i didnt think that this would install a framework in the OSX system or that this could even override the brew packages.

thank you very much