This repository has been archived by the owner. It is now read-only.

--use-gcc does not properly use gcc instead of llvm #17243

Closed
jstultz opened this Issue Jan 22, 2013 · 5 comments

Comments

Projects
None yet
3 participants

jstultz commented Jan 22, 2013

https://gist.github.com/4591011

Building ruby 1.9.2 with --use-gcc specified results in segmentation faults when using enumerators. The same behavior occurs without --use-gcc specified.

If --env=std is given to the install, the segmentation faults do not occur.

This is on OSX 10.8.2, which like most recent versions of OSX and Xcode, has /usr/bin/gcc symlinked to /usr/bin/llvm-gcc

Contributor

jacknagel commented Jan 22, 2013

10.8 doesn't have gcc; it can't "properly" use gcc if there isn't a gcc to use.

Further, this repo only supports the ruby 1.9.3 formula.

Contributor

mistydemeo commented Jan 22, 2013

superenv is improperly using "gcc" as the value for --use-gcc, which is a symlink to llvm-gcc. stdenv has a special case to allow a homebrewed apple-gcc42 but superenv doesn't.

jstultz commented Jan 22, 2013

10.8 by default does not have gcc, but you can install it (one way is via apple-gcc42 in homebrew/dupes), which I have running (as clearly evidenced by the fact that specifying --env=std correctly uses gcc). Even if there weren't a gcc that you could use on 10.8, it would still be misleading and seemingly incorrect for the 'use-gcc' flag to use llvm instead, considering that the homebrew man page documentation for --use-gcc states "attempt to compile using GCC. This is useful for systems whose default compiler is LLVM-GCC."

Finally, the fact 1.9.2 is unsupported is somewhat irrelevant considering that the problem isn't so much that 1.9.2 in particular doesn't build properly, but rather that the --use-gcc flag does not behave as intended (and as a consequence, ruby 1.9.2 along with any other thing that requires real gcc to build, will not build)

Contributor

mistydemeo commented Jan 23, 2013

Should be fixed here: mistydemeo/homebrew@master...superenv

Will push after a little more testing.

Contributor

mistydemeo commented Jan 27, 2013

Fixed, sorry about the delay.

Sharpie pushed a commit to Sharpie/homebrew that referenced this issue Feb 19, 2013

superenv: --use-gcc should specify gcc-4.2
Since 'gcc' is a symlink to 'llvm-gcc' on Xcode 4.3+, --use-gcc and
--use-llvm were doing exactly the same thing. Combined with the
previous commit, this allows users with either a leftover
/usr/bin/gcc-4.2 or a homebrewed apple-gcc42 to build with gcc.

This doesn't however fix Xcode-only systems with apple-gcc42.

Fixes #17243.

@xu-cheng xu-cheng locked and limited conversation to collaborators Feb 16, 2016

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.