Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 537684 - sys-devel/binutils-config-4: drop -macosx_version_min from ld wrapper
Summary: sys-devel/binutils-config-4: drop -macosx_version_min from ld wrapper
Status: RESOLVED FIXED
Alias: None
Product: Gentoo/Alt
Classification: Unclassified
Component: Prefix Support (show other bugs)
Hardware: All OS X
: Normal normal (vote)
Assignee: Gentoo Prefix
URL: http://article.gmane.org/gmane.linux....
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-01-25 22:55 UTC by Michael Weiser
Modified: 2015-02-02 08:36 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments
remove option override from toolchain-prefix-wrapper (toolchain-prefix-wrapper-0.3.1723-no-mac-osx-min-version.patch,3.48 KB, patch)
2015-01-25 22:56 UTC, Michael Weiser
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Weiser 2015-01-25 22:55:03 UTC
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.
Comment 1 Michael Weiser 2015-01-25 22:56:23 UTC
Created attachment 394882 [details, diff]
remove option override from toolchain-prefix-wrapper
Comment 2 Fabian Groffen gentoo-dev 2015-01-31 18:20:47 UTC
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.
Comment 3 Michael Weiser 2015-01-31 19:03:57 UTC
Won't that break bootstrapping because the ebuild needs autotools now?
Comment 4 Fabian Groffen gentoo-dev 2015-01-31 19:14:13 UTC
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.
Comment 5 Michael Weiser 2015-01-31 19:57:12 UTC
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.
Comment 6 Fabian Groffen gentoo-dev 2015-01-31 20:03:02 UTC
I see no eautoreconf at all.  I'm pretty sure I'd never do that for I know that's going to break bootstraps.
Comment 7 Michael Weiser 2015-01-31 20:59:34 UTC
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.
Comment 8 Michael Weiser 2015-01-31 22:50:22 UTC
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
Comment 9 Fabian Groffen gentoo-dev 2015-02-02 08:36:13 UTC
Oops, did that now