Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[configure][darwin] fix macos11 sysroot required for compiler tests #18931

Merged
merged 1 commit into from
Dec 21, 2020

Conversation

fuzzard
Copy link
Contributor

@fuzzard fuzzard commented Dec 13, 2020

Description

Depends build fix with MacOS 11 host

@ksooo @phunkyfish give this a run if you have time.

Motivation and Context

macos11 throws a linker error when running autoconf compiler/linker tests
we need to supply isysroot, however we do not want to pollute CFLAGS/CXXFLAGS/LDFLAGS with host/target sysroot,
So we clean up after the tests are carried out

How Has This Been Tested?

Locally against target macos and tvos

Screenshots (if appropriate):

Types of change

  • Bug fix (non-breaking change which fixes an issue)
  • Clean up (non-breaking change which removes non-working, unmaintained functionality)
  • Improvement (non-breaking change which improves existing functionality)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that will cause existing functionality to change)
  • Cosmetic change (non-breaking change that doesn't touch code)
  • None of the above (please explain below)

Checklist:

  • My code follows the Code Guidelines of this project
  • My change requires a change to the documentation, either Doxygen or wiki
  • I have updated the documentation accordingly
  • I have read the Contributing document
  • I have added tests to cover my change
  • All new and existing tests passed

@ksooo
Copy link
Member

ksooo commented Dec 13, 2020

@fuzzard does not work here, sorry.

@ksooo
Copy link
Member

ksooo commented Dec 13, 2020

This is my configure call: ./configure --host=x86_64-apple-darwin --with-platform=macos --enable-debug=yes

@fuzzard
Copy link
Contributor Author

fuzzard commented Dec 13, 2020

Make sure you run ./bootstrap again

@ksooo
Copy link
Member

ksooo commented Dec 13, 2020

Make sure you run ./bootstrap again

I did.

@fuzzard
Copy link
Contributor Author

fuzzard commented Dec 14, 2020

try now. Had the wrong conclusion on the autoconf call requiring the check.

edit: actually, this will be better. The previous one would have led to issues come c++17 checking i believe.

tools/depends/configure.ac Outdated Show resolved Hide resolved
@ksooo
Copy link
Member

ksooo commented Dec 14, 2020

Getting much further with the latest force-push.
Now, it breaks while building mariadb.

/Applications/Xcode.app/Contents/Developer/usr/bin/make -C mariadb
/Applications/Xcode.app/Contents/Developer/usr/bin/make -C macosx11.0_x86_64-target-debug/build
[  8%] Built target auth_gssapi_client
[ 91%] Built target mariadb_obj
[ 93%] Linking C shared library libmariadb.dylib
clang: warning: argument unused during compilation: '-fheinous-gnu-extensions' [-Wunused-command-line-argument]
Undefined symbols for architecture x86_64:
  "_libiconv", referenced from:
      _mariadb_convert_string in ma_charset.c.o
  "_libiconv_close", referenced from:
      _mariadb_convert_string in ma_charset.c.o
  "_libiconv_open", referenced from:
      _mariadb_convert_string in ma_charset.c.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[5]: *** [libmariadb/libmariadb.3.dylib] Error 1
make[4]: *** [libmariadb/CMakeFiles/libmariadb.dir/all] Error 2
make[3]: *** [all] Error 2
make[2]: *** [macosx11.0_x86_64-target-debug/build/libmariadb/libmariadbclient.a] Error 2
make[1]: *** [mariadb] Error 2
make: *** [target/.installed-macosx11.0_x86_64-target-debug] Error 2

@fuzzard fuzzard force-pushed the configure_macos11 branch 3 times, most recently from db5a61b to e6500db Compare December 16, 2020 03:24
@fuzzard
Copy link
Contributor Author

fuzzard commented Dec 16, 2020

Give this latest update a whirl @ksooo

Jenkins build this please

@fuzzard fuzzard force-pushed the configure_macos11 branch 2 times, most recently from 649a37b to 3eaa964 Compare December 16, 2020 07:58
@fuzzard
Copy link
Contributor Author

fuzzard commented Dec 16, 2020

Jenkins build this please

@ksooo
Copy link
Member

ksooo commented Dec 16, 2020

Hmm, ...

/Applications/Xcode.app/Contents/Developer/usr/bin/make -C libpng
cd /Users/Shared/xbmc-depends/xbmc-tarballs; /usr/bin/curl -Ls --create-dirs -f -O http:https://mirrors.kodi.tv/build-deps/sources/libpng-1.6.37.tar.gz
make[2]: *** [/Users/Shared/xbmc-depends/xbmc-tarballs/libpng-1.6.37.tar.gz] Error 18
make[1]: *** [libpng] Error 2
make: *** [target/.installed-macosx11.1_x86_64-target-debug] Error 2

@fuzzard
Copy link
Contributor Author

fuzzard commented Dec 16, 2020

That's a curl failure to download properly. Unrelated to any changes. Try remove the partial tarball and run again

@ksooo
Copy link
Member

ksooo commented Dec 16, 2020

OKay, now I get while linking python3...

/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -L/Users/Shared/xbmc-depends/macosx11.1_x86_64-target-debug/lib -Wl,-search_paths_first -stdlib=libc++  -liconv      -Wl,-stack_size,1000000  -framework CoreFoundation -o python.exe Programs/python.o libpython3.8.a -ldl   -framework CoreFoundation -lintl -framework CoreFoundation -liconv                           -L/Users/Shared/xbmc-depends/macosx11.1_x86_64-target-debug/lib -lssl -lcrypto              -L/Users/Shared/xbmc-depends/macosx11.1_x86_64-target-debug/lib -lz           -L/Users/Shared/xbmc-depends/macosx11.1_x86_64-target-debug/lib -lsqlite3 '-DMODULE_NAME="sqlite3"'  -L/Users/Shared/xbmc-depends/macosx11.1_x86_64-target-debug/lib -lffi   -L/Users/Shared/xbmc-depends/macosx11.1_x86_64-target-debug/lib -lbz2  -framework SystemConfiguration -framework CoreFoundation   
ld: library not found for -liconv
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[3]: *** [python.exe] Error 1
make[2]: *** [.installed-macosx11.1_x86_64-target-debug] Error 2
make[1]: *** [python3] Error 2
make: *** [target/.installed-macosx11.1_x86_64-target-debug] Error 2

@fuzzard
Copy link
Contributor Author

fuzzard commented Dec 16, 2020

Can you run bootstrap+configure again for.me and paste the output of the configure command. Looks like it's not detecting linkage of iconv. It was handling it in my latest test case, but I've force pushed a couple times yesterday

@ksooo
Copy link
Member

ksooo commented Dec 16, 2020

[kai@Kais-MacBook-Pro ~/src/github/ksooo/xbmc/tools/depends (shield)]$ ./configure --host=x86_64-apple-darwin --with-platform=macos --enable-debug=yes
configure: WARNING: if you wanted to set the --build type, don't use --host.
    If a cross compiler is detected then cross compile mode will be used
checking build system type... x86_64-apple-darwin20.2.0
checking host system type... x86_64-apple-darwin
checking for ccache... no
checking for curl... /usr/bin/curl
checking for tar... /usr/bin/tar
found xcodebuild at /Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild
checking for ranlib... /usr/bin/ranlib
checking for ld... /Applications/Xcode.app/Contents/Developer/usr/bin/ld
checking for ar... /usr/bin/ar
checking for readelf... readelf
checking for strip... /usr/bin/strip
checking for as... /usr/bin/as
checking for nm... /usr/bin/nm
checking for objdump... /usr/bin/objdump
checking for gcc... /Applications/Xcode.app/Contents/Developer/usr/bin/gcc
checking for g++... /Applications/Xcode.app/Contents/Developer/usr/bin/g++
checking for x86_64-apple-darwin-ranlib... no
checking for ranlib... /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib
configure: WARNING: using cross tools not prefixed with host triplet
checking for x86_64-apple-darwin-ld... no
checking for ld... /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld
checking for x86_64-apple-darwin-ar... no
checking for ar... /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ar
checking for x86_64-apple-darwin-readelf... no
checking for readelf... no
checking for x86_64-apple-darwin-strip... no
checking for strip... /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/strip
checking for x86_64-apple-darwin-as... no
checking for as... /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/as
checking for x86_64-apple-darwin-nm... no
checking for nm... /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/nm
checking for x86_64-apple-darwin-objdump... no
checking for objdump... /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/objdump
checking for x86_64-apple-darwin-clang... no
checking for clang... /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang
checking for x86_64-apple-darwin-clang++... no
checking for clang++... /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++
checking for x86_64-apple-darwin-gcc... /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... yes
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang accepts -g... yes
checking for /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang option to accept ISO C89... none needed
checking how to run the C preprocessor... /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -E
checking whether we are using the GNU C++ compiler... yes
checking whether /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ accepts -g... yes
checking whether /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ supports C++14 features by default... no
checking whether /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ supports C++14 features with -std=c++14... yes
checking for "arm*"... auto is not "arm*"
checking for gawk... no
checking for mawk... no
checking for nawk... no
checking for awk... awk
checking for main in -lz... yes
checking for library containing iconv_open... -liconv
checking for unzip... yes
checking for zip... yes
configure: creating ./config.status
config.status: creating target/config.site
config.status: creating native/config.site.native
config.status: creating Makefile.include
config.status: creating target/Toolchain.cmake
config.status: creating target/config-binaddons.site
config.status: creating target/Toolchain_binaddons.cmake
target/config.site -> /Users/Shared/xbmc-depends/macosx11.1_x86_64-target-debug/share/config.site
target/config-binaddons.site -> /Users/Shared/xbmc-depends/x86_64-darwin20.2.0-native/share/config-binaddons.site
target/Toolchain.cmake -> /Users/Shared/xbmc-depends/macosx11.1_x86_64-target-debug/share/Toolchain.cmake
target/Toolchain_binaddons.cmake -> /Users/Shared/xbmc-depends/macosx11.1_x86_64-target-debug/share/Toolchain_binaddons.cmake
native/config.site.native -> /Users/Shared/xbmc-depends/x86_64-darwin20.2.0-native/share/config.site
-e 

#------- configuration -------#
-e ccache:		 no
-e build type:	 debug
-e toolchain:	 /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain
-e cpu:		 x86_64
-e host:		 x86_64-apple-darwin
-e cflags:		 -fheinous-gnu-extensions -no-cpp-precomp -g -D_DEBUG 
-e cxxflags:	 -std=c++14 -no-cpp-precomp -stdlib=libc++ -g -D_DEBUG 
-e ldflags:	 -Wl,-search_paths_first -stdlib=libc++  -liconv 
-e ffmpeg options:	 
-e prefix:		 /Users/Shared/xbmc-depends
-e depends:	 /Users/Shared/xbmc-depends/macosx11.1_x86_64-target-debug

@fuzzard
Copy link
Contributor Author

fuzzard commented Dec 16, 2020

refactoring bites me in the ass. Hopefully this should work this time.

@fuzzard
Copy link
Contributor Author

fuzzard commented Dec 17, 2020

Jenkins build this please

Copy link
Member

@ksooo ksooo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested. Works now. Thank you.

tools/depends/configure.ac Outdated Show resolved Hide resolved
macos 11 throws a linker error when running autoconf compiler/linker checks
we need to supply isysroot, however we do not want to pollute CFLAGS/CXXFLAGS/LDFLAGS to permanently have
host sysroot, as flags are carried through into platform_XXflags for crosscompilation
@fuzzard
Copy link
Contributor Author

fuzzard commented Dec 19, 2020

jenkins build this please

1 similar comment
@ksooo
Copy link
Member

ksooo commented Dec 19, 2020

jenkins build this please

@ksooo ksooo merged commit d02291e into xbmc:master Dec 21, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants