Opened 14 years ago
Closed 12 years ago
#28706 closed enhancement (wontfix)
pkgconfig @0.25 build with clang
Reported by: | bradskins@… | Owned by: | ryandesign (Ryan Carsten Schmidt) |
---|---|---|---|
Priority: | Normal | Milestone: | |
Component: | ports | Version: | |
Keywords: | Cc: | ||
Port: | pkgconfig |
Description
Same type of issue as ticket #28705. Please add the following line to the portfile to compile with clang 2.8.
configure.cflags -std=gnu89
Change History (8)
comment:1 Changed 14 years ago by mf2k (Frank Schima)
Cc: | ryandesign@… removed |
---|---|
Owner: | changed from macports-tickets@… to ryandesign@… |
comment:2 Changed 14 years ago by ryandesign (Ryan Carsten Schmidt)
comment:3 Changed 14 years ago by bradskins@…
I think reporting it in both places would be good. This issues has much to do with the build system so a quick change in the portfile will be an improvement, and will not effect other build methods. We put the fix here so others that want to use clang as the default compiler can find solutions to the common errors.
comment:4 Changed 13 years ago by ryandesign (Ryan Carsten Schmidt)
MacPorts does build ports with clang by default now, if the user has Xcode 4.2 or later. But I have not heard any other reports of this problem. Is this ticket still valid with pkgconfig 0.26?
comment:5 Changed 13 years ago by bradskins@…
pkgconfig builds with clang, but does not build properly with -flto.
I had a whole bunch of clang reports to file, but faced a bit of resistance MacPorts-side and it took the wind out of my sails. Should I start submitting more clang reports? I noticed there are many ports that force llvm-gcc-4.2 (if clang) without considering the clang version. Many of these ports that force llvm-gcc-4.2 can be build just fine with newer versions of clang. Also, I'd like to have portfiles that automatically drop the -flto flag if the program is known to have problems.
brad
Apple clang version 2.1 (tags/Apple/clang-163.7.1) (based on LLVM 3.0svn)
comment:6 Changed 13 years ago by ryandesign (Ryan Carsten Schmidt)
The only versions of Xcode under which MacPorts would use clang by default are Xcode 4.2 and higher. The ports that say to use llvm-gcc-4.2 instead of clang apparently had trouble building with that version of clang. If you can supply patches that allow those ports to build with clang instead, that would be great. Ideally you'd submit them to the developers of the software in question as well.
Under what circumstances would MacPorts build pkgconfig with -flto
?
comment:7 Changed 13 years ago by bradskins@…
Under my conditions. :) I always edit /opt/local/share/macports/Tcl/port1.0/portconfigure.tcl and change the following:
default configure.march {corei7-avx} default configure.optflags {"-Oz -flto"} default configure.compiler {clang}
Coming from FreeBSD and Gentoo, it's just always how I've done it. What's the point of compiling from source if you don't tune it to your hardware? (besides dependencies á la carte)
comment:8 Changed 12 years ago by ryandesign (Ryan Carsten Schmidt)
Resolution: | → wontfix |
---|---|
Status: | new → closed |
I've tried reproducing a build failure when using clang and -Oz -flto, and depending on which clang I use, I either can't reproduce a build failure, or adding -std=gnu89 does not fix it.
We don't support making the kinds of modifications you're making to MacPorts. If you want to continue to make them, that's fine, but you're on your own if you run into problems.
Please either take it up with the developers of pkg-config or keep a locally-modified version of the pkgconfig portfile with your changes.
As to the question "What's the point of compiling from source", we just never got around to offering pre-compiled binaries, until recently: MacPorts 2 downloads pre-compiled binaries from our servers when available.
Shouldn't this rather be reported upstream? MacPorts does not, and is not scheduled to, build any ports with clang by default at this time. (Only ports that specifically want clang would so indicate; the pkgconfig port does not do this.)