apotocki / boost-iosx

Builds Boost C++ libraries and packages them as XCFrameworks for iOS (simulator and device), visionOS (simulator and device), macOS, and Mac Catalyst (Intel & Apple Silicon M1).
Boost Software License 1.0
63 stars 17 forks source link

Failure to build on Apple Silicon #9

Closed Archdoog closed 2 years ago

Archdoog commented 2 years ago

Hello there. Running the build script on Apple Silicon results in this error:

...
   clang++       ...  unewdata.cpp
   clang++       ...  uoptions.cpp
   clang++       ...  uparse.cpp
   clang++       ...  writesrc.cpp
   clang++       ...  xmlparser.cpp
ar r -c ../../lib/libicutu.a collationinfo.ao dbgutil.ao denseranges.ao filestrm.ao filetools.ao flagparser.ao package.ao pkg_genc.ao pkg_gencmn.ao pkg_icu.ao pkgitems.ao ppucd.ao swapimpl.ao toolutil.ao ucbuf.ao ucln_tu.ao ucm.ao ucmstate.ao udbgutil.ao unewdata.ao uoptions.ao uparse.ao writesrc.ao xmlparser.ao
ranlib ../../lib/libicutu.a
/Applications/Xcode.app/Contents/Developer/usr/bin/make[1]: Making `all' in `ctestfw'
   clang         ...  ctest.c
   clang++       ...  datamap.cpp
   clang++       ...  testdata.cpp
   clang++       ...  tstdtmod.cpp
   clang         ...  ucln_ct.c
   clang++       ...  uperf.cpp
ar r -c libicutest.a ctest.ao datamap.ao testdata.ao tstdtmod.ao ucln_ct.ao uperf.ao
ranlib libicutest.a
/Applications/Xcode.app/Contents/Developer/usr/bin/make[1]: Making `all' in `makeconv'
cd ../.. \
         && CONFIG_FILES=tools/makeconv/makeconv.1 CONFIG_HEADERS= /bin/sh ./config.status
   clang         ...  gencnvex.c
   clang++       ...  genmbcs.cpp
   clang++       ...  makeconv.cpp
   clang         ...  ucnvstat.c
config.status: creating tools/makeconv/makeconv.1
clang++ --std=c++17 -W -Wall -pedantic -Wpointer-arith -Wwrite-strings -Wno-long-long -Wno-ambiguous-reversed-operator  -Qunused-arguments -Wno-parentheses-equality   -o ../../bin/makeconv gencnvex.o genmbcs.o makeconv.o ucnvstat.o -L../../lib -licutu -L../../lib -licui18n -L../../lib -licuuc -L../../stubdata -licudata -lpthread -lm  
Updating files: 100% (9412/9412), done.
Warning: Unable to find target lstm_res, a dependency of brkitr_brk
ld: warning: ignoring file ../../lib/libicutu.a, building for macOS-arm64 but attempting to link with file built for unknown-unsupported file format ( 0x21 0x3C 0x61 0x72 0x63 0x68 0x3E 0x0A 0x2F 0x20 0x20 0x20 0x20 0x20 0x20 0x20 )
ld: warning: ignoring file ../../stubdata/libicudata.a, building for macOS-arm64 but attempting to link with file built for unknown-unsupported file format ( 0x21 0x3C 0x61 0x72 0x63 0x68 0x3E 0x0A 0x2F 0x20 0x20 0x20 0x20 0x20 0x20 0x20 )
ld: warning: ignoring file ../../lib/libicui18n.a, building for macOS-arm64 but attempting to link with file built for unknown-unsupported file format ( 0x21 0x3C 0x61 0x72 0x63 0x68 0x3E 0x0A 0x2F 0x20 0x20 0x20 0x20 0x20 0x20 0x20 )
ld: warning: ignoring file ../../lib/libicuuc.a, building for macOS-arm64 but attempting to link with file built for unknown-unsupported file format ( 0x21 0x3C 0x61 0x72 0x63 0x68 0x3E 0x0A 0x2F 0x20 0x20 0x20 0x20 0x20 0x20 0x20 )
Undefined symbols for architecture arm64:
  "_T_FileStream_close", referenced from:
      readFile(ConvData*, char const*, UErrorCode*) in makeconv.o
  "_T_FileStream_open", referenced from:
      readFile(ConvData*, char const*, UErrorCode*) in makeconv.o
  "_T_FileStream_readLine", referenced from:
      readFile(ConvData*, char const*, UErrorCode*) in makeconv.o
      readHeader(ConvData*, _FileStream*, UErrorCode*) in makeconv.o
  "icu_71::CharString::appendPathPart(icu_71::StringPiece, UErrorCode&)", referenced from:
      _main in makeconv.o
  "icu_71::CharString::ensureEndsWithFileSeparator(UErrorCode&)", referenced from:
      _main in makeconv.o
  "icu_71::CharString::append(char const*, int, UErrorCode&)", referenced from:
      icu_71::CharString::append(icu_71::StringPiece, UErrorCode&) in makeconv.o
  "icu_71::CharString::truncate(int)", referenced from:
      _main in makeconv.o
  "icu_71::StringPiece::StringPiece(char const*)", referenced from:
      _main in makeconv.o
  "icu_71::CharString::lastIndexOf(char) const", referenced from:
      _main in makeconv.o
  "_findBasename", referenced from:
      _main in makeconv.o
      createConverter(ConvData*, char const*, UErrorCode*) in makeconv.o
  "_getLongPathname", referenced from:
      _main in makeconv.o
  "_u_errorName_71", referenced from:
      _main in makeconv.o
      writeConverterData(ConvData*, char const*, char const*, UErrorCode*) in makeconv.o
  "_u_getDataDirectory_71", referenced from:
      _main in makeconv.o
  "_u_getVersion_71", referenced from:
      _main in makeconv.o
  "_u_parseArgs", referenced from:
      _main in makeconv.o
  "_u_skipWhitespace", referenced from:
      readFile(ConvData*, char const*, UErrorCode*) in makeconv.o
  "_u_strFromUTF32_71", referenced from:
      _generateToUTable in gencnvex.o
  "_ucm_checkBaseExt", referenced from:
      createConverter(ConvData*, char const*, UErrorCode*) in makeconv.o
  "_ucm_checkValidity", referenced from:
      createConverter(ConvData*, char const*, UErrorCode*) in makeconv.o
  "_ucm_close", referenced from:
      cleanupConvData(ConvData*) in makeconv.o
  "_ucm_countChars", referenced from:
      MBCSIsValid(NewConverter*, unsigned char const*, int) in genmbcs.o
      createConverter(ConvData*, char const*, UErrorCode*) in makeconv.o
  "_ucm_findFallback", referenced from:
      removeFallback(MBCSData*, unsigned int) in genmbcs.o
      setFallback(MBCSData*, unsigned int, int) in genmbcs.o
  "_ucm_moveMappings", referenced from:
      createConverter(ConvData*, char const*, UErrorCode*) in makeconv.o
  "_ucm_open", referenced from:
      readFile(ConvData*, char const*, UErrorCode*) in makeconv.o
  "_ucm_optimizeStates", referenced from:
      MBCSPostprocess(MBCSData*, UConverterStaticData const*) in genmbcs.o
  "_ucm_parseBytes", referenced from:
      readHeader(ConvData*, _FileStream*, UErrorCode*) in makeconv.o
  "_ucm_parseHeaderLine", referenced from:
      readHeader(ConvData*, _FileStream*, UErrorCode*) in makeconv.o
  "_ucm_printMapping", referenced from:
      _CnvExtAddTable in gencnvex.o
      _generateToUTable in gencnvex.o
      _generateFromUTable in gencnvex.o
  "_ucm_processStates", referenced from:
      readFile(ConvData*, char const*, UErrorCode*) in makeconv.o
  "_ucm_readTable", referenced from:
      readFile(ConvData*, char const*, UErrorCode*) in makeconv.o
  "_ucm_sortTable", referenced from:
      createConverter(ConvData*, char const*, UErrorCode*) in makeconv.o
  "_udata_create", referenced from:
      writeConverterData(ConvData*, char const*, char const*, UErrorCode*) in makeconv.o
  "_udata_finish", referenced from:
      writeConverterData(ConvData*, char const*, char const*, UErrorCode*) in makeconv.o
  "_udata_writeBlock", referenced from:
      _CnvExtWrite in gencnvex.o
      MBCSWrite(NewConverter*, UConverterStaticData const*, UNewDataMemory*, int) in genmbcs.o
      writeConverterData(ConvData*, char const*, char const*, UErrorCode*) in makeconv.o
  "_uprv_free_71", referenced from:
      _CnvExtClose in gencnvex.o
      MBCSClose(NewConverter*) in genmbcs.o
      MBCSDestruct(MBCSData*) in genmbcs.o
      icu_71::MaybeStackArray<char, 40>::releaseArray() in makeconv.o
  "_uprv_isInvariantString_71", referenced from:
      _main in makeconv.o
  "_uprv_malloc_71", referenced from:
      _CnvExtOpen in gencnvex.o
      _MBCSOpen in genmbcs.o
      MBCSStartMappings(MBCSData*) in genmbcs.o
  "_uprv_stricmp_71", referenced from:
      _main in makeconv.o
  "_utm_alloc", referenced from:
      _CnvExtAddTable in gencnvex.o
      _CnvExtWrite in gencnvex.o
  "_utm_allocN", referenced from:
      _generateToUTable in gencnvex.o
      _getFromUBytesValue in gencnvex.o
      _generateFromUTable in gencnvex.o
  "_utm_close", referenced from:
      _CnvExtClose in gencnvex.o
  "_utm_countItems", referenced from:
      _CnvExtAddTable in gencnvex.o
      _CnvExtWrite in gencnvex.o
      _generateToUTable in gencnvex.o
      _getFromUBytesValue in gencnvex.o
      _generateFromUTable in gencnvex.o
  "_utm_getStart", referenced from:
      _CnvExtWrite in gencnvex.o
  "_utm_open", referenced from:
      _CnvExtAddTable in gencnvex.o
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [../../bin/makeconv] Error 1
make[1]: *** [all-recursive] Error 2
make: *** [all-recursive] Error 2

/opt/homebrew/Cellar/cocoapods/1.11.3/libexec/gems/cocoapods-1.11.3/lib/cocoapods/executable.rb:73:in `execute_command'
/opt/homebrew/Cellar/cocoapods/1.11.3/libexec/gems/cocoapods-1.11.3/lib/cocoapods/executable.rb:27:in `block in executable'
/opt/homebrew/Cellar/cocoapods/1.11.3/libexec/gems/cocoapods-1.11.3/lib/cocoapods/installer/pod_source_preparer.rb:66:in `block (2 levels) in run_prepare_command'
/opt/homebrew/Cellar/cocoapods/1.11.3/libexec/gems/cocoapods-1.11.3/lib/cocoapods/installer/pod_source_preparer.rb:60:in `chdir'
/opt/homebrew/Cellar/cocoapods/1.11.3/libexec/gems/cocoapods-1.11.3/lib/cocoapods/installer/pod_source_preparer.rb:60:in `block in run_prepare_command'
/opt/homebrew/Cellar/cocoapods/1.11.3/libexec/gems/cocoapods-1.11.3/lib/cocoapods/user_interface.rb:64:in `section'
/opt/homebrew/Cellar/cocoapods/1.11.3/libexec/gems/cocoapods-1.11.3/lib/cocoapods/installer/pod_source_preparer.rb:59:in `run_prepare_command'
/opt/homebrew/Cellar/cocoapods/1.11.3/libexec/gems/cocoapods-1.11.3/lib/cocoapods/installer/pod_source_preparer.rb:37:in `prepare!'
/opt/homebrew/Cellar/cocoapods/1.11.3/libexec/gems/cocoapods-1.11.3/lib/cocoapods/downloader/cache.rb:288:in `block in copy_and_clean'
/opt/homebrew/Cellar/cocoapods/1.11.3/libexec/gems/cocoapods-1.11.3/lib/cocoapods/downloader/cache.rb:128:in `lock'
/opt/homebrew/Cellar/cocoapods/1.11.3/libexec/gems/cocoapods-1.11.3/lib/cocoapods/downloader/cache.rb:99:in `write_lock'
/opt/homebrew/Cellar/cocoapods/1.11.3/libexec/gems/cocoapods-1.11.3/lib/cocoapods/downloader/cache.rb:285:in `copy_and_clean'
/opt/homebrew/Cellar/cocoapods/1.11.3/libexec/gems/cocoapods-1.11.3/lib/cocoapods/downloader/cache.rb:244:in `block (2 levels) in uncached_pod'
/opt/homebrew/Cellar/cocoapods/1.11.3/libexec/gems/cocoapods-1.11.3/lib/cocoapods/downloader/cache.rb:242:in `each'
/opt/homebrew/Cellar/cocoapods/1.11.3/libexec/gems/cocoapods-1.11.3/lib/cocoapods/downloader/cache.rb:242:in `block in uncached_pod'
/opt/homebrew/Cellar/cocoapods/1.11.3/libexec/gems/cocoapods-1.11.3/lib/cocoapods/downloader/cache.rb:266:in `in_tmpdir'
/opt/homebrew/Cellar/cocoapods/1.11.3/libexec/gems/cocoapods-1.11.3/lib/cocoapods/downloader/cache.rb:238:in `uncached_pod'
/opt/homebrew/Cellar/cocoapods/1.11.3/libexec/gems/cocoapods-1.11.3/lib/cocoapods/downloader/cache.rb:33:in `download_pod'
/opt/homebrew/Cellar/cocoapods/1.11.3/libexec/gems/cocoapods-1.11.3/lib/cocoapods/downloader.rb:42:in `download'
/opt/homebrew/Cellar/cocoapods/1.11.3/libexec/gems/cocoapods-1.11.3/lib/cocoapods/installer/pod_source_installer.rb:118:in `download_source'
/opt/homebrew/Cellar/cocoapods/1.11.3/libexec/gems/cocoapods-1.11.3/lib/cocoapods/installer/pod_source_installer.rb:69:in `install!'
/opt/homebrew/Cellar/cocoapods/1.11.3/libexec/gems/cocoapods-1.11.3/lib/cocoapods/installer.rb:563:in `install_source_of_pod'
/opt/homebrew/Cellar/cocoapods/1.11.3/libexec/gems/cocoapods-1.11.3/lib/cocoapods/installer.rb:514:in `block (2 levels) in install_pod_sources'
/opt/homebrew/Cellar/cocoapods/1.11.3/libexec/gems/cocoapods-1.11.3/lib/cocoapods/user_interface.rb:86:in `titled_section'
/opt/homebrew/Cellar/cocoapods/1.11.3/libexec/gems/cocoapods-1.11.3/lib/cocoapods/installer.rb:513:in `block in install_pod_sources'
/opt/homebrew/Cellar/cocoapods/1.11.3/libexec/gems/cocoapods-1.11.3/lib/cocoapods/installer.rb:496:in `each'
/opt/homebrew/Cellar/cocoapods/1.11.3/libexec/gems/cocoapods-1.11.3/lib/cocoapods/installer.rb:496:in `install_pod_sources'
/opt/homebrew/Cellar/cocoapods/1.11.3/libexec/gems/cocoapods-1.11.3/lib/cocoapods/installer.rb:255:in `block in download_dependencies'
/opt/homebrew/Cellar/cocoapods/1.11.3/libexec/gems/cocoapods-1.11.3/lib/cocoapods/user_interface.rb:64:in `section'
/opt/homebrew/Cellar/cocoapods/1.11.3/libexec/gems/cocoapods-1.11.3/lib/cocoapods/installer.rb:254:in `download_dependencies'
/opt/homebrew/Cellar/cocoapods/1.11.3/libexec/gems/cocoapods-1.11.3/lib/cocoapods/installer.rb:162:in `install!'
/opt/homebrew/Cellar/cocoapods/1.11.3/libexec/gems/cocoapods-1.11.3/lib/cocoapods/command/install.rb:52:in `run'
/opt/homebrew/Cellar/cocoapods/1.11.3/libexec/gems/claide-1.1.0/lib/claide/command.rb:334:in `run'
/opt/homebrew/Cellar/cocoapods/1.11.3/libexec/gems/cocoapods-1.11.3/lib/cocoapods/command.rb:52:in `run'
/opt/homebrew/Cellar/cocoapods/1.11.3/libexec/gems/cocoapods-1.11.3/bin/pod:55:in `<top (required)>'
/opt/homebrew/Cellar/cocoapods/1.11.3/libexec/bin/pod:25:in `load'
/opt/homebrew/Cellar/cocoapods/1.11.3/libexec/bin/pod:25:in `<main>'

[!] The Podfile contains command line tool target(s) (ICUdep) which are attempting to integrate dynamic frameworks or libraries.
This may not behave as expected, because command line tools are usually distributed as a single binary and cannot contain their own dynamic dependencies.

I'll continue to explore and try to figure out what's going on, but any help from experience building this would be beneficial.

apotocki commented 2 years ago

Hi. It looks like icu4c library hasn't been built or something wrong with it. Try to clear cocoapod cache at ~/Library/Caches/CocoaPods/Pods/Release/icu4c-iosx and repeat the building procedure. It would be great to see building log notes related to icu4c too. By the way, my working laptop is also on Apple Silicon and I've never faced such kinds of errors there.