Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 527656 - dev-libs/glib-2.40.2 fails to build on OS X (Yosemite)
Summary: dev-libs/glib-2.40.2 fails to build on OS X (Yosemite)
Alias: None
Product: Gentoo/Alt
Classification: Unclassified
Component: Prefix Support (show other bugs)
Hardware: All OS X
: Normal normal (vote)
Assignee: Gentoo Prefix
Depends on:
Blocks: 527514
  Show dependency tree
Reported: 2014-10-31 19:48 UTC by Guilherme Amadio
Modified: 2014-12-02 11:20 UTC (History)
2 users (show)

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

build.log (build.log,478.13 KB, application/octet-stream)
2014-10-31 19:49 UTC, Guilherme Amadio
glib-2.40.2-osx.patch (glib-2.40.2-osx.patch,2.95 KB, patch)
2014-10-31 20:55 UTC, Guilherme Amadio
Details | Diff
glib-2.40.2-r1.ebuild (glib-2.40.2-r1.ebuild,11.35 KB, text/plain)
2014-10-31 20:57 UTC, Guilherme Amadio

Note You need to log in before you can comment on or make changes to this bug.
Description Guilherme Amadio gentoo-dev 2014-10-31 19:48:26 UTC
The package dev-libs/glib-2.40.2 fails to build on OS X Yosemite because it automatically detects OS X and tries to build a framework, which fails due to the new interfaces. Building manually with carbon/cocoa disabled works without problems.

Reproducible: Always
Comment 1 Guilherme Amadio gentoo-dev 2014-10-31 19:49:37 UTC
Created attachment 387906 [details]
Comment 2 Guilherme Amadio gentoo-dev 2014-10-31 20:55:54 UTC
Created attachment 387908 [details, diff]

This is a patch to correct automagic detection of OS X by glib-2.40.2.
Comment 3 Guilherme Amadio gentoo-dev 2014-10-31 20:57:45 UTC
Created attachment 387910 [details]

This new ebuild adds the USE flag aqua. On Yosemite, USE=-aqua compiles normally.
Comment 4 Fabian Groffen gentoo-dev 2014-11-02 20:42:54 UTC
I'm not sure if the aim of USE=-aqua for Yosemite is the best thing to do.  I'd rather see movement on fixing Clang.
Comment 5 Guilherme Amadio gentoo-dev 2014-11-03 01:52:50 UTC
Yes, this is just a workaround so I could get a working prefix. In any case, it is better to have the USE flag to turn on or off. Now that I got a prefix working, I can test stuff more easily. I would have done more work on clang already if I were more familiar with how to create new profiles, etc. Maybe we should set up a time for a chat at #gentoo-prefix about how to work on using clang when you have time.
Comment 6 Ruud Koolen (RETIRED) archtester Gentoo Infrastructure gentoo-dev Security 2014-11-27 13:12:22 UTC
Fixed for now due to using clang for python.
Comment 7 yegle 2014-12-02 04:23:47 UTC
So how is this bug fixed?

Looks like it was fixed by using clang instead of gcc (I can see from the build log), but I can't find where the black magic been added.

Also the current fix is not ideal. I have sys-devel/clang installed so when building glib the clang in $EPREFIX will be used and failed in ./configure step. Tried to set CC=/usr/bin/clang in make.conf without uninstalling sys-devel/clang but it doesn't work. I finally installed sys-devel/glib by uninstall clang from prefix.
Comment 8 Fabian Groffen gentoo-dev 2014-12-02 08:24:53 UTC
Someone did a crude hack, because of a preference to generate other problems over just fixing the thing the right way.
Comment 9 Guilherme Amadio gentoo-dev 2014-12-02 10:06:05 UTC
(In reply to Fabian Groffen from comment #8)

Fabian, we are using the host clang because you said my fix of compiling without aqua support with gcc-apple was not acceptable. Yes, using the host clang is not the ideal solution, but the prefix-provided clang doesn't work yet, as far as I know. If it does, I'll be happy to look into using it to compile glib.

In the mean time, our users needed a working bootstrap process on Yosemite, so the temporary fix is to compile some packages like python and glib with host clang while the prefix clang doesn't work. Once the prefix-provided clang is patched appropriately, we will fix this and other packages to use it instead. What Ruud and I didn't want was to leave Yosemite bootstrap broken while the prefix clang isn't ready, because several users were trying to bootstrap and failing.

@yegle: The fix is currently in the file ${EPREFIX}/usr/portage/profiles/darwin/macos/10.10/profile.bashrc if you'd like to change anything. BTW, how did you emerge clang in your prefix? Last time I tried, it didn't compile for me.

Also, should we reopen this bug and only close it after proper clang support in prefix has been merged?