Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 603580 - =sys-devel/binutils-apple-7.3.1 fails to compile with llvm-3.9
Summary: =sys-devel/binutils-apple-7.3.1 fails to compile with llvm-3.9
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: https://groups.google.com/forum/#!top...
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-12-23 12:38 UTC by Fabian Groffen
Modified: 2017-01-02 08:12 UTC (History)
2 users (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Fabian Groffen gentoo-dev 2016-12-23 12:38:26 UTC
ld/parsers/libunwind/DwarfInstructions.hpp:974:2: error: redeclaration of
      'compile_time_assert_failed' with a different type: 'int
      [((int)CFI_Parser<A>::kMaxRegisterNumber > (int)DW_X86_64_RET_ADDR) ? 1 :
      -1]' vs 'int [1]'
        COMPILE_TIME_ASSERT( (int)CFI_Parser<A>::kMaxRegisterNumber > (i...
        ^
ld/parsers/libunwind/InternalMacros.h:50:14: note: expanded from macro
      'COMPILE_TIME_ASSERT'
                extern int compile_time_assert_failed[ ( expr ) ? 1 : -...
                           ^
ld/parsers/libunwind/Registers.hpp:1134:2: note: previous declaration is here
        COMPILE_TIME_ASSERT( sizeof(Registers_arm64) < sizeof(unw_context_t) );
        ^
Comment 1 Fabian Groffen gentoo-dev 2016-12-24 20:30:50 UTC
I'm doing work on 8.1, but that one has some issues with a new "tapi" that is nowhere to be found.
Comment 2 yuex 2016-12-25 04:15:04 UTC
FYI, I tried the system clang on MacOS Sierra (10.12.2), i.e., Apple LLVM version 8.0.0 (clang-800.0.42.1). It could compile binutils-apple.
Comment 3 Rutger van Bergen 2017-01-01 12:15:06 UTC
(In reply to yuex from comment #2)
> FYI, I tried the system clang on MacOS Sierra (10.12.2), i.e., Apple LLVM
> version 8.0.0 (clang-800.0.42.1). It could compile binutils-apple.

Does that constitute (part of) a workaround for this issue, in some way?
(Yes, I am quite keen to get Prefix running on this MacBook that's in front of me...)
Comment 4 yuex 2017-01-01 12:29:42 UTC
(In reply to Rutger van Bergen from comment #3)
> (In reply to yuex from comment #2)
> > FYI, I tried the system clang on MacOS Sierra (10.12.2), i.e., Apple LLVM
> > version 8.0.0 (clang-800.0.42.1). It could compile binutils-apple.
> 
> Does that constitute (part of) a workaround for this issue, in some way?
> (Yes, I am quite keen to get Prefix running on this MacBook that's in front
> of me...)

You can just comment out those COMPILE_TIME_ASSERT invocations. From its name, it should not affect runtime behavior once it has compiled. But you have to make a patch, and add it to the ebuild file.
Comment 5 yuex 2017-01-01 12:31:36 UTC
(In reply to Rutger van Bergen from comment #3)
> (In reply to yuex from comment #2)
> > FYI, I tried the system clang on MacOS Sierra (10.12.2), i.e., Apple LLVM
> > version 8.0.0 (clang-800.0.42.1). It could compile binutils-apple.
> 
> Does that constitute (part of) a workaround for this issue, in some way?
> (Yes, I am quite keen to get Prefix running on this MacBook that's in front
> of me...)

Nope. Swapping clang to system's can compile this package but will fail on others later
Comment 6 Fabian Groffen gentoo-dev 2017-01-01 12:42:53 UTC
actual fix for clang is in:
http://lists.llvm.org/pipermail/cfe-commits/Week-of-Mon-20160829/169553.html

I think working around it is easier for the moment.
Comment 7 yuex 2017-01-01 12:54:00 UTC
You can also just edit make.conf to use system's clang. When this package gets compiled, Ctrl-C out to switch back. And bootstrap again. I remember this can bring you to stage3 where other packages (one or two, I can't remember) will fail. But somehow you can manage it to emerge -e system. Then the prefix it workable if you generate the startprefix script manually or from the internet.

To pass emerge -e system, you have to modify ebuild file.

Just a little bit off-topic that I bootstrapped successfully several days ago after DIY ed some patches to several packages. But the fact is that I finally decided to use macports. It's somehow a primitive version of portage. Some features are missing. And some others are no match to emerge. But still it provides something like Portage.

I also tried to use docker to chroot a data volume to install amd64 gentoo. But the mapped filesystem IO is too slow to be productive.

Gentoo Prefix on OSX is a cool idea. I'm sure that it will get better if more people contribute. I'll keep an eye on it.
Comment 8 Fabian Groffen gentoo-dev 2017-01-01 13:17:13 UTC
Sorry to hear that!  Thanks for trying though.

I've pushed a fix for the 3.7.1 ebuild.  Should go in tomorrow's snapshot.
Comment 9 Rutger van Bergen 2017-01-01 13:45:02 UTC
Thanks to you both for responding so quickly and thoroughly. 

I appreciate there are "easier" alternatives for installing and running Linux packages on macOS, but I am going to stick with Gentoo Prefix. I've been a Gentoo user since the days when stage3 tarballs were considered cop-outs for wimps, and not running "emerge --sync && emerge -DuNa world" at least once a week would almost certainly leave portage broken beyond repair. I'm just a big fan of the basic Gentoo concept, and I find the idea of applying it to a context that is not friendly towards it irresistibly charming.

And yes, I understand and accept that currently, this translates to a process of "try, try, and try again", with a lot of patience mixed into it. Although patience is not one of my fortes, it simply is what it is.

So, I will await the snapshot with the fix for the 3.7.1 ebuild, and then see how much further I get with that.
Comment 10 Rutger van Bergen 2017-01-02 08:09:51 UTC
I have just successfully completed the build of binutils-apple-7.3.1 with the ebuild that includes the COMPILE_TIME_ASSERT sed invocation.
Comment 11 Fabian Groffen gentoo-dev 2017-01-02 08:12:17 UTC
I bumped the snapshot, testing a bootstrap as I type.  I assume this particular problem is fixed now, thanks! :)