Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

--use-gcc: search HOMEBREW_PREFIX/bin for gcc-4.2 #9384

Closed
wants to merge 1 commit into from

4 participants

@mistydemeo
Owner

re: #9369

@Sharpie added the apple-gcc42 formula to homebrew-alt recently, but it couldn't actually be used by Homebrew since the gcc-4.2 lookup is hardcoded to /usr/bin.

Whitelisting an Apple gcc-4.2 formula makes sense to me - there are many people dealing with Xcode 4.2 headaches. Any objections?

@mikemcquaid
Owner

Seems like a good idea. Longer-term I'd like to try and make this unnecessary by fixing packages that rely on GCC (or we'll be lumbered with it forever). Should probably make this get automatically pulled in if you use a package that requires GCC and are on Xcode 4.2.

@jacknagel
Owner

I'm in favor of this, but I think that the case where both /usr/bin/gcc-4.2 and HOMEBREW_PREFIX/bin/gcc-4.2 exist should default to /usr/bin/gcc-4.2.

@jacknagel
Owner

(As part of my work on fails_with, I'm updating the foo_build_version logic which has to take this into account, as well.)

@adamv
Owner

@jacknagel Consider redoing even the name "fails_with" altogether, if it makes more sense. If there's a need for a more complex set of OS-specific compiler checks, for instance.

@mistydemeo
Owner

@jacknagel Good point, I'll update that.

And yeah, @mikemcquaid, that would be ideal - but medium-term I think there are going to be significant packages this is an issue for. Since apple-gcc42 is in homebrew-alt it's just a semi-official solution anyway - we should just enable people to use it without needing to hack homebrew core.

@mikemcquaid
Owner

I think we should stop accepting new packages that fail with LLVM (if we haven't already) and we/I should try and go through the 88/1863 (as of now) packages and try and fix them.

@jacknagel
Owner

I think we should stop accepting new packages that fail with LLVM (if we haven't already)

As a historical note, it looks there haven't been many new formula that were known to fail with LLVM at merge time (since the advent of fails_with_llvm, that is):

$ git log --diff-filter=A -Sfails_with_llvm --oneline -- Library/Formula/ | wc -l
       8

Since we have the majority of popular C/C++ packages in-core, new stuff that doesn't build with llvm-gcc or clang is pretty rare.

@mistydemeo mistydemeo --use-gcc: search HOMEBREW_PREFIX/bin for gcc-4.2
This also removes the :force filtering for the gcc-4.2 check error.
db74ffc
@mistydemeo
Owner

Updated.

I also removed the :force filter in the GCC path check. It makes sense to me to have it the check always on.

@jacknagel
Owner

Agreed, as it stands now it should error out if "gcc isn't gcc".

The CompilerSelector stuff I'm working on will be smart enough to not even try it if it's actually a symlink to llvm-gcc.

@mistydemeo
Owner

Awesome.

I'm going to go ahead and push this.

@mistydemeo mistydemeo closed this pull request from a commit
@mistydemeo mistydemeo ENV.gcc: search HOMEBREW_PREFIX/bin for gcc-4.2
Allow the use of a Homebrewed gcc-4.2 in order to support homebrew-alt's
apple-gcc42 formula.

This also removes the :force filtering for the gcc-4.2 check error.

Closes #9384.

Signed-off-by: Misty De Meo <mistydemeo@gmail.com>
e404417
@etehtsea etehtsea referenced this pull request from a commit in etehtsea/homebrew
@mistydemeo mistydemeo ENV.gcc: search HOMEBREW_PREFIX/bin for gcc-4.2
Allow the use of a Homebrewed gcc-4.2 in order to support homebrew-alt's
apple-gcc42 formula.

This also removes the :force filtering for the gcc-4.2 check error.

Closes #9384.

Signed-off-by: Misty De Meo <mistydemeo@gmail.com>
c913eb4
@mikemcquaid
Owner

A bit of research indicates that more stuff should build with Clang than LLVM-GCC as Clang is using LLVM 3.0. We should definitely use that over llvm-gcc with Xcode 4.2.

@dvj dvj referenced this pull request from a commit
Commit has since been removed from the repository and is no longer available.
@dvj dvj referenced this pull request from a commit
Commit has since been removed from the repository and is no longer available.
@dvj dvj referenced this pull request from a commit
Commit has since been removed from the repository and is no longer available.
@Sharpie Sharpie referenced this pull request from a commit
Commit has since been removed from the repository and is no longer available.
@TylerBrock TylerBrock referenced this pull request from a commit
Commit has since been removed from the repository and is no longer available.
@cacoco cacoco referenced this pull request from a commit
@mistydemeo mistydemeo ENV.gcc: search HOMEBREW_PREFIX/bin for gcc-4.2
Allow the use of a Homebrewed gcc-4.2 in order to support homebrew-alt's
apple-gcc42 formula.

This also removes the :force filtering for the gcc-4.2 check error.

Closes #9384.

Signed-off-by: Misty De Meo <mistydemeo@gmail.com>
0503d6d
@Sharpie Sharpie referenced this pull request from a commit in Sharpie/homebrew
@mistydemeo mistydemeo ENV.gcc: search HOMEBREW_PREFIX/bin for gcc-4.2
Allow the use of a Homebrewed gcc-4.2 in order to support homebrew-alt's
apple-gcc42 formula.

This also removes the :force filtering for the gcc-4.2 check error.

Closes #9384.

Signed-off-by: Misty De Meo <mistydemeo@gmail.com>
0a63dfa
@snakeyroc3 snakeyroc3 referenced this pull request from a commit in snakeyroc3/homebrew
@mistydemeo mistydemeo ENV.gcc: search HOMEBREW_PREFIX/bin for gcc-4.2
Allow the use of a Homebrewed gcc-4.2 in order to support homebrew-alt's
apple-gcc42 formula.

This also removes the :force filtering for the gcc-4.2 check error.

Closes #9384.

Signed-off-by: Misty De Meo <mistydemeo@gmail.com>
af9d653
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Jan 11, 2012
  1. @mistydemeo

    --use-gcc: search HOMEBREW_PREFIX/bin for gcc-4.2

    mistydemeo authored
    This also removes the :force filtering for the gcc-4.2 check error.
This page is out of date. Refresh to see the latest.
Showing with 5 additions and 3 deletions.
  1. +5 −3 Library/Homebrew/extend/ENV.rb
View
8 Library/Homebrew/extend/ENV.rb
@@ -83,13 +83,15 @@ def gcc_4_0_1
alias_method :gcc_4_0, :gcc_4_0_1
def gcc args = {}
- self['CC'] = "/usr/bin/gcc-4.2"
- self['CXX'] = "/usr/bin/g++-4.2"
+ gcc_path = Pathname.new "/usr/bin/gcc-4.2"
+ gxx_path = Pathname.new "/usr/bin/g++-4.2"
+ self['CC'] = gcc_path.exist? ? gcc_path : HOMEBREW_PREFIX+'bin/gcc-4.2'
+ self['CXX'] = gxx_path.exist? ? gxx_path : HOMEBREW_PREFIX+'bin/g++-4.2'
replace_in_cflags '-O4', '-O3'
set_cpu_cflags 'core2 -msse4', :penryn => 'core2 -msse4.1', :core2 => 'core2', :core => 'prescott'
@compiler = :gcc
- raise "GCC could not be found" if args[:force] and not File.exist? ENV['CC'] \
+ raise "GCC could not be found" if not File.exist? ENV['CC'] \
or (Pathname.new(ENV['CC']).realpath.to_s =~ /llvm/)
end
alias_method :gcc_4_2, :gcc
Something went wrong with that request. Please try again.