The ld wrapper fromtoolchain-prefix-wrapper-0.3.1723 forces the -macosx_version_min onto the ld command line. That breaks cross-compilation for e.g. armv6 using binutils-apple-6.1 and a multitarget clang. Reproducible: Always Steps to Reproduce: michael <at> osx1010:~ # which clang /Users/michael/nobak/gentoo/usr/bin/clang michael <at> osx1010:~ # clang -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk -arch armv7 -o t t.c Actual Results: ld: building for MacOSX, but linking against dylib built for iOS Simulator file '/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/lib/libSystem.dylib' for architecture armv7 x86_64-apple-darwin14-clang-3.5.1: error: linker command failed with exit code 1 (use -v to see invocation) Expected Results: michael <at> osx1010:~ # file t t: Mach-O arm_v7 executable Xcode clang accepts the same command line nicely and produces arm output. After removing the parameter override from the ld wrapper using the attached patch and changed ebuild, all is well: Also, I do think the override is not neccessary (at least any more) because the way ld64 is configured by binutils-apple now it will pick up its default deployment target from the ebuild environment. And that's explicitly set by all the prefix darwin profiles.
Created attachment 394882 [details, diff] remove option override from toolchain-prefix-wrapper
Ok, the svn repo that we had was destroyed and not migrated to git apparently for I asked so (https://bugs.gentoo.org/show_bug.cgi?id=513182#c11). We figured out now I probably meant the overlay, so this is now a work in progress to get the git repos for this thing. For the time being, I applied your patch to the ebuild.
Won't that break bootstrapping because the ebuild needs autotools now?
I figured not, since you simply remove the bits to emit the macosx deployment target thinghy. Configure might still make an attempt to set the right version, but we got that covered for now.
What I mean is: The ebuild now uses eautoreconf to completely regenerate configure from configure.ac. From my grep of bootstrap-prefix.sh the necessary tools will not be present in the bootstrap environment and its highly uncertain that all hosts' versions will do the right thing or work at all.
I see no eautoreconf at all. I'm pretty sure I'd never do that for I know that's going to break bootstraps.
Sorry, I remembered wrong what I had attached here and assumed what the ebuild would look like now. Should have been looking at the updated ebuild from the start. My bad.
Makefile now regenerates and re-runs configure because it's older than configure.ac after patching. That gives loads of warnings. Perhaps we could just patch the C file and leave everything else as it is for now? /Users/michael/Gentoo/var/tmp/portage/sys-devel/binutils-config-4-r1/work/toolchain-prefix-wrapper-0.3.1723/build-aux/missing: line 51: aclocal-1.12: command not found WARNING: 'aclocal-1.12' is missing on your system. You should only need it if you modified 'acinclude.m4' or 'configure.ac'. You might want to install the Automake and Perl packages. Grab them from any GNU archive site. cd . && /Users/michael/Gentoo/bin/bash /Users/michael/Gentoo/var/tmp/portage/sys-devel/binutils-config-4-r1/work/toolchain-prefix-wrapper-0.3.1723/build-aux/missing --run automake-1.12 --foreign /Users/michael/Gentoo/var/tmp/portage/sys-devel/binutils-config-4-r1/work/toolchain-prefix-wrapper-0.3.1723/build-aux/missing: line 51: automake-1.12: command not found WARNING: 'automake-1.12' is missing on your system. You should only need it if you modified 'Makefile.am', 'acinclude.m4' or 'configure.ac'. You might want to install the Automake and Perl packages. Grab them from any GNU archive site. [...] * QA Notice: Automake "maintainer mode" detected: * * CDPATH="${ZSH_VERSION+.}:" && cd . && /Users/michael/Gentoo/bin/bash /Users/michael/Gentoo/var/tmp/portage/sys-devel/binutils-config-4-r1/work/toolchain-prefix-wrapper-0.3.1723/build-aux/missing --run aclocal-1.12 * cd . && /Users/michael/Gentoo/bin/bash /Users/michael/Gentoo/var/tmp/portage/sys-devel/binutils-config-4-r1/work/toolchain-prefix-wrapper-0.3.1723/build-aux/missing --run automake-1.12 --foreign * CDPATH="${ZSH_VERSION+.}:" && cd . && /Users/michael/Gentoo/bin/bash /Users/michael/Gentoo/var/tmp/portage/sys-devel/binutils-config-4-r1/work/toolchain-prefix-wrapper-0.3.1723/build-aux/missing --run autoconf * * If you patch Makefile.am, configure.in, or configure.ac then you * should use autotools.eclass and eautomake or eautoreconf. Exceptions * are limited to system packages for which it is impossible to run * autotools during stage building. See * http://www.gentoo.org/proj/en/qa/autofailure.xml for more information. * QA Notice: command not found: * * /Users/michael/Gentoo/var/tmp/portage/sys-devel/binutils-config-4-r1/work/toolchain-prefix-wrapper-0.3.1723/build-aux/missing: line 51: aclocal-1.12: command not found * /Users/michael/Gentoo/var/tmp/portage/sys-devel/binutils-config-4-r1/work/toolchain-prefix-wrapper-0.3.1723/build-aux/missing: line 51: automake-1.12: command not found * QA Notice: Unrecognized configure options: * * --with-macosx-version-min * --with-macosx-version-min
Oops, did that now