You are not logged in.

#26 2008-05-22 06:41:35

pressh
Developer/TU
From: Netherlands
Registered: 2005-08-14
Posts: 1,719

Re: gcc downgrade

shining wrote:
pressh wrote:
shining wrote:

To pressh:
Why do you need to redefine the cflags in the pkgbuild? They are already defined in makepkg.conf.

for i686 you can indeed just use the ones defined in makepkg.conf, which it actually does because you export the same. You could of course export nothing and get the same result.

For x86_64 however, the CFLAGS are named differently to what the gcc4 understands. Note the difference between x86-64 and x86_64. Not exporting the CFLAGS for x86_64 will most likely fail the build.

Still, I don't understand why you don't simply define directly the correct x86-64 cflags in makepkg.conf, but I am probably missing something..

I'm not sure that you're missing something, it may also be me, I don't even have x86_64 hardware and my only experience building packages for it is on a x86_64 build machine.

I'll try to explain my reasoning. Yes you can directly change the CFLAGS in makepkg.conf and everything should build fine. However, for building packages with gcc4 you'll have to change the CFLAGS again to $CARCH. This may be okay for packages you only use at home if you don't mind editing makepkg, but for packages uploaded in the repos and AUR not exporting the CFLAGS will result in a lot of 'this PKGBUILD is not working bugs'.

So yes, the way I see it there are other ways to do it than exporting those variables. Changing the cflags directly in makepkg.conf, maybe even use 'unset CFLAGS' in the PKGBUILD will work (I have not tested that one though). Am I missing something obviously in my reasoning?

Offline

#27 2008-05-22 06:59:47

Allan
Pacman
From: Brisbane, AU
Registered: 2007-06-09
Posts: 11,392
Website

Re: gcc downgrade

shining wrote:
pressh wrote:
shining wrote:

To pressh:
Why do you need to redefine the cflags in the pkgbuild? They are already defined in makepkg.conf.

for i686 you can indeed just use the ones defined in makepkg.conf, which it actually does because you export the same. You could of course export nothing and get the same result.

For x86_64 however, the CFLAGS are named differently to what the gcc4 understands. Note the difference between x86-64 and x86_64. Not exporting the CFLAGS for x86_64 will most likely fail the build.

Still, I don't understand why you don't simply define directly the correct x86-64 cflags in makepkg.conf, but I am probably missing something..

These were the changes required to get a package to build using gcc-3.4 which used x86-64 and not x86_64 like the current gcc's do.   You don't want to make that change global in makepkg.conf or else it will screw over anything built with the current gcc.

Offline

#28 2008-05-22 07:56:47

shining
Pacman Developer
Registered: 2006-05-10
Posts: 2,043

Re: gcc downgrade

Oh ok, sorry. The information was already all there but for some reason I did not understand..
The CFLAGS defined in makepkg.conf is the one for the normal / default gcc version, which is gcc 4.
So when you have to build a stupid package which only works with gcc 3, you have to override these cflags.
Sorry for all the noise..

So that is yet another reason for trying to make the software build with gcc 4 first smile


pacman roulette : pacman -S $(pacman -Slq | LANG=C sort -R | head -n $((RANDOM % 10)))

Offline

Board footer

Powered by FluxBB