Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 681884 - app-arch/gzip unconditionally sets NO_ASM
Summary: app-arch/gzip unconditionally sets NO_ASM
Status: RESOLVED INVALID
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo's Team for Core System packages
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-03-27 22:11 UTC by Alec Ari
Modified: 2020-08-18 12:13 UTC (History)
0 users

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 Alec Ari 2019-03-27 22:11:45 UTC
Currently, export DEFS="NO_ASM" is set unconditionally. Consider the following:

app-arch/gzip/gzip-1.10.ebuild:

src_configure() {
	use static && append-flags -static
	# avoid asm if pic
	if use pic ; then
		export DEFS="NO_ASM"
	fi
	econf --disable-gcc-warnings #663928
}

Thoughts? Thanks!
Comment 1 Alec Ari 2019-03-28 00:20:51 UTC
Another thing I just noticed, the NEWS file in the gzip source says: "When configuring gzip, ./configure DEFS='...-DNO_ASM...' now
  suppresses assembler again.  [bug introduced in gzip-1.3.5]"

After examining the code, I found this:

tailor.h: #  if !defined(NO_ASM) && !defined(ASMV)

NO_ASM in this context is a GCC macro, and these are called with -D in CFLAGS. The gzip developers offer you to amend CFLAGS using the DEFS variable.

I believe:

export DEFS="NO_ASM"

is the incorrect syntax here, and from a GCC perspective, the current ebuild doesn't make much sense either. I'm pretty sure that:

export DEFS="-DNO_ASM"

should be used in place of it, if you really want to disable potentially non-friendly PIC code.
Comment 2 Hanno Böck gentoo-dev 2020-04-30 10:18:44 UTC
One additional note: On amd64 the NO_ASM option does nothing at all, because it seems gzip does not contain any amd64-optimized assembly code.
Comment 3 Alec Ari 2020-04-30 18:47:39 UTC
Am I misreading this? I made a forum post about this bug and they said that "NO_ASM" is conditional in this context, and is only set if "pic" USE is enabled.

Line:

use pic && export DEFS="NO_ASM"

That does not seem conditional to me.. If it is, I don't see it.
Comment 4 Mike Gilbert gentoo-dev 2020-04-30 19:00:21 UTC
That means "if the pic USE flag is enabled, set the DEFS variable to NO_ASM".
Comment 5 Mike Gilbert gentoo-dev 2020-04-30 19:04:24 UTC
If the DEFS variable is set to any string containing "NO_ASM", assembly code is disabled.

http://git.savannah.gnu.org/cgit/gzip.git/tree/configure.ac?h=v1.10#n210
Comment 6 Alec Ari 2020-04-30 23:42:53 UTC
Ah, yeah my ebuild writing style is out of date:

https://devmanual.gentoo.org/ebuild-writing/use-conditional-code/index.html

"forms which are occasionally seen in older code must not be used."

Didn't see that. Portage should probably warn users they're using the old way of doing it.

Cheers.