Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 237648 - media-libs/mesa-7.3 improperly sets --enable-asm/--disable-asm
Summary: media-libs/mesa-7.3 improperly sets --enable-asm/--disable-asm
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Unspecified (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Gentoo X packagers
URL:
Whiteboard:
Keywords: Inclusion
Depends on:
Blocks:
 
Reported: 2008-09-14 17:38 UTC by Jonathan Callen (RETIRED)
Modified: 2009-07-22 08:19 UTC (History)
1 user (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jonathan Callen (RETIRED) gentoo-dev 2008-09-14 17:38:24 UTC
According to the comments in the ebuild, --enable-asm should only be passed to econf when USE=-pic and ARCH != sparc.  Currently, when ARCH == sparc, --enable-asm is passed, and otherwise --disable-asm is passed. For correct functionality, the following probably should be used:

    myconf="${myconf} $(use sparc && echo --disable-asm || $(use_enable !pic asm))"

Reproducible: Always

Steps to Reproduce:
Comment 1 Donnie Berkholz (RETIRED) gentoo-dev 2008-09-14 18:38:52 UTC
Fixed in 7.2_rc1, great catch!
Comment 2 Jonathan Callen (RETIRED) gentoo-dev 2008-09-14 19:38:03 UTC
There still is a problem with the method in which --enable/disable-asm is selected: the logic was reversed, but still is wrong.  The current logic is:

  !pic & !sparc : enable
  !pic & sparc : disable
  pic & !sparc : enable (should be disable)
  pic & sparc : disable

If you don't like the line I listed in comment #0, then you can do the following:

  use sparc || myconf="${myconf) $(use_enable !pic asm)"
  use sparc && myconf="${myconf} --disable-asm"

or even:
  myconf="${myconf} $(use_enable !pic asm)"
  use sparc && myconf="${myconf} --disable-asm"

The reason is that ./configure only looks at the last --enable/disable-asm parameter passed, so the $(use_enable !sparc asm) line is overriding the $(use_enable !pic asm) line.
Comment 3 Donnie Berkholz (RETIRED) gentoo-dev 2008-09-14 19:51:53 UTC
The default is right for sparc so I'm removing that line and just leaving pic.
Comment 4 Jonathan Callen (RETIRED) gentoo-dev 2009-03-11 08:29:45 UTC
Reopening because it seems that the fix was dropped in 7.2, only 7.2_rc1 had the logic fix applied - please fix 7.2, 7.3, and 7.3-r1.
Comment 5 Donnie Berkholz (RETIRED) gentoo-dev 2009-03-16 06:10:31 UTC
7.2 looks right, 7.3 is wrong (reversed logic vs 7.2). I don't remember where I mentioned it, but 7.3 appears to have revived a lot of bugs that were fixed in 7.2.
Comment 6 Rémi Cardona (RETIRED) gentoo-dev 2009-03-23 12:37:05 UTC
Meh, I went through the overlay's and portage's histories and we pretty much screwed up over time.

Hopefully, 7.3-r2 should be exactly the same as -9999 from the overlay which has all the proper fixes.

7.3-r2 is under p.mask until it gets a little more testing. Please do try it.

Thanks
Comment 7 Jonathan Callen (RETIRED) gentoo-dev 2009-03-29 03:17:55 UTC
I finally got a chance to look at the new 7.4_rc1 ebuild, and it still shows the problem mentioned in comment #2, namely that even though there is a "pic" useflag that claims to enable/disable asm, the ebuild unconditionally sets --enable-asm when ${ARCH} != sparc, and --disable-asm when ${ARCH} == sparc.
Comment 8 Rémi Cardona (RETIRED) gentoo-dev 2009-03-29 16:10:58 UTC
Patches welcome as I don't know what the proper use of --*-asm is.

Tomas, do you have an idea by any chance? :)

Thanks
Comment 9 Jonathan Callen (RETIRED) gentoo-dev 2009-03-29 17:03:49 UTC
(In reply to comment #8)
> Patches welcome as I don't know what the proper use of --*-asm is.

Assuming that the comments in the ebuild are correct, the easiest fix would be to change the line:
    myconf="${myconf} $(use_enable !sparc asm)"
to:
    use sparc && myconf="${myconf} --disable-asm"

which would properly override the $(use_enable !pic asm) in the previous line only on ARCH=sparc, and do nothing otherwise.

If comment #3 is still true, then just deleting the line entirely (and the comment preceding) would work.  I cannot verify that, as I do not have a sparc machine to test.
Comment 10 Rémi Cardona (RETIRED) gentoo-dev 2009-03-29 21:44:13 UTC
How about we ask the sparc folks to make sure ?

@sparc, what say you?

Thanks
Comment 11 Friedrich Oslage (RETIRED) gentoo-dev 2009-04-05 12:09:45 UTC
(In reply to comment #3)
> The default is right for sparc so I'm removing that line and just leaving pic.

still true, at least for 7.3 and 7.4. didn't check the other ones.

The configure script disables asm for all arches except x86, amd64 and ppc, event if --enable-asm is passed. therefore the line in the ebuild can be removed.

this is really good because 7.3-r1 (which is about to go stable) always passes --enable-asm for sparc :)
Comment 12 Rémi Cardona (RETIRED) gentoo-dev 2009-04-05 15:43:09 UTC
(In reply to comment #11)
> > The default is right for sparc so I'm removing that line and just leaving pic.
> 
> still true, at least for 7.3 and 7.4. didn't check the other ones.
> 
> The configure script disables asm for all arches except x86, amd64 and ppc,
> event if --enable-asm is passed. therefore the line in the ebuild can be
> removed.
> 
> this is really good because 7.3-r1 (which is about to go stable) always passes
> --enable-asm for sparc :)

/me is a bit confused...

So what's the correct fix? We should just not bother with asm ?

Thanks
Comment 13 Friedrich Oslage (RETIRED) gentoo-dev 2009-04-05 16:35:22 UTC
> So what's the correct fix? We should just not bother with asm ?

Right, no special code in the ebuild needed for sparc. If the ebuild passes --enable-asm to the configure script the conf script will turn it into --disable-asm if host=sparc
Comment 14 Rémi Cardona (RETIRED) gentoo-dev 2009-05-06 15:09:30 UTC
@sparc,

7.4.1-r1 is based on a nearly-rewrited ebuild where the bug should be gone. Please confirm.

Thanks
Comment 15 Jonathan Callen (RETIRED) gentoo-dev 2009-05-08 20:04:17 UTC
(In reply to comment #14)
> @sparc,
> 
> 7.4.1-r1 is based on a nearly-rewrited ebuild where the bug should be gone.
> Please confirm.
> 
> Thanks
> 

I can verify that the pertinent part of the ebuild is unchanged, except for moving a comment to the preceding line.  This indicates to me that the bug has probably not been fixed, as of 7.4.1-r2.
Comment 16 Tomáš Chvátal (RETIRED) gentoo-dev 2009-07-22 08:19:44 UTC
Fixed as per comment 13 in both overlay and mesa 7.5-r1 (which is in main tree).