Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 356991 - dev-java/icedtea partially does not respect CFLAGS
Summary: dev-java/icedtea partially does not respect CFLAGS
Status: CONFIRMED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal minor (vote)
Assignee: Andrew John Hughes
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: icedtea-tracker 364495
  Show dependency tree
 
Reported: 2011-03-01 16:14 UTC by Richard
Modified: 2018-03-17 19:41 UTC (History)
8 users (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 Richard 2011-03-01 16:14:17 UTC
I have an amd64 system. I was looking at the icedtea as it was building and I noticed that it overrode my CFLAGS. Here is one line from its output:

g++ -DLINUX -D_GNU_SOURCE -DAMD64 -DPRODUCT -I. -I../generated/adfiles -I../generated/jvmtifiles -I/var/tmp/portage/dev-java/icedtea-6.1.9.7-r1/work/icedtea6-1.9.7/openjdk/hotspot/src/share/vm/asm -I/var/tmp/portage/dev-java/icedtea-6.1.9.7-r1/work/icedtea6-1.9.7/openjdk/hotspot/src/share/vm/ci -I/var/tmp/portage/dev-java/icedtea-6.1.9.7-r1/work/icedtea6-1.9.7/openjdk/hotspot/src/share/vm/classfile -I/var/tmp/portage/dev-java/icedtea-6.1.9.7-r1/work/icedtea6-1.9.7/openjdk/hotspot/src/share/vm/code -I/var/tmp/portage/dev-java/icedtea-6.1.9.7-r1/work/icedtea6-1.9.7/openjdk/hotspot/src/share/vm/compiler -I/var/tmp/portage/dev-java/icedtea-6.1.9.7-r1/work/icedtea6-1.9.7/openjdk/hotspot/src/share/vm/gc_implementation -I/var/tmp/portage/dev-java/icedtea-6.1.9.7-r1/work/icedtea6-1.9.7/openjdk/hotspot/src/share/vm/gc_implementation/shared -I/var/tmp/portage/dev-java/icedtea-6.1.9.7-r1/work/icedtea6-1.9.7/openjdk/hotspot/src/share/vm/gc_implementation/parallelScavenge -I/var/tmp/portage/dev-java/icedtea-6.1.9.7-r1/work/icedtea6-1.9.7/openjdk/hotspot/src/share/vm/gc_implementation/parNew -I/var/tmp/portage/dev-java/icedtea-6.1.9.7-r1/work/icedtea6-1.9.7/openjdk/hotspot/src/share/vm/gc_implementation/g1 -I/var/tmp/portage/dev-java/icedtea-6.1.9.7-r1/work/icedtea6-1.9.7/openjdk/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep -I/var/tmp/portage/dev-java/icedtea-6.1.9.7-r1/work/icedtea6-1.9.7/openjdk/hotspot/src/share/vm/gc_interface -I/var/tmp/portage/dev-java/icedtea-6.1.9.7-r1/work/icedtea6-1.9.7/openjdk/hotspot/src/share/vm/interpreter -I/var/tmp/portage/dev-java/icedtea-6.1.9.7-r1/work/icedtea6-1.9.7/openjdk/hotspot/src/share/vm/libadt -I/var/tmp/portage/dev-java/icedtea-6.1.9.7-r1/work/icedtea6-1.9.7/openjdk/hotspot/src/share/vm/memory -I/var/tmp/portage/dev-java/icedtea-6.1.9.7-r1/work/icedtea6-1.9.7/openjdk/hotspot/src/share/vm/oops -I/var/tmp/portage/dev-java/icedtea-6.1.9.7-r1/work/icedtea6-1.9.7/openjdk/hotspot/src/share/vm/opto -I/var/tmp/portage/dev-java/icedtea-6.1.9.7-r1/work/icedtea6-1.9.7/openjdk/hotspot/src/share/vm/prims -I/var/tmp/portage/dev-java/icedtea-6.1.9.7-r1/work/icedtea6-1.9.7/openjdk/hotspot/src/share/vm/runtime -I/var/tmp/portage/dev-java/icedtea-6.1.9.7-r1/work/icedtea6-1.9.7/openjdk/hotspot/src/share/vm/services -I/var/tmp/portage/dev-java/icedtea-6.1.9.7-r1/work/icedtea6-1.9.7/openjdk/hotspot/src/share/vm/shark -I/var/tmp/portage/dev-java/icedtea-6.1.9.7-r1/work/icedtea6-1.9.7/openjdk/hotspot/src/share/vm/utilities -I/var/tmp/portage/dev-java/icedtea-6.1.9.7-r1/work/icedtea6-1.9.7/openjdk/hotspot/src/cpu/x86/vm -I/var/tmp/portage/dev-java/icedtea-6.1.9.7-r1/work/icedtea6-1.9.7/openjdk/hotspot/src/os/linux/vm -I/var/tmp/portage/dev-java/icedtea-6.1.9.7-r1/work/icedtea6-1.9.7/openjdk/hotspot/src/os_cpu/linux_x86/vm -I../generated -DHOTSPOT_RELEASE_VERSION="\"19.0-b09\"" -DHOTSPOT_BUILD_TARGET="\"product\"" -DHOTSPOT_BUILD_USER="\"root\"" -DHOTSPOT_LIB_ARCH=\"amd64\" -DJRE_RELEASE_VERSION="\"1.6.0_20-b20\"" -DHOTSPOT_VM_DISTRO="\"OpenJDK\"" -DDERIVATIVE_ID="\"IcedTea6 1.9.7\"" -DDISTRIBUTION_ID="\"Built on Gentoo Base System release 2.0.1 (Tue Mar  1 10:42:22 EST 2011)\"" -march=core2 -mtune=core2 -mcx16 -msahf -msse4.1 --param l1-cache-size=32 --param l1-cache-line-size=64 --param l2-cache-size=6144 -O2 -pipe -DCOMPILER2  -fno-rtti -fno-exceptions -D_REENTRANT -fcheck-new -m64 -pipe -g -DCOMPILER2 -fpic -fno-rtti -fno-exceptions -D_REENTRANT -fcheck-new -m64 -pipe -g -O3 -fno-strict-aliasing -DVM_LITTLE_ENDIAN -D_LP64=1 -fno-omit-frame-pointer -Werror -Wpointer-arith -Wsign-compare    -c -o psParallelCompact.o /var/tmp/portage/dev-java/icedtea-6.1.9.7-r1/work/icedtea6-1.9.7/openjdk/hotspot/src/share/vm/gc_implementation/parallelScavenge/psParallelCompact.cpp 

My CFLAGS are "-march=core2 -mtune=core2 -mcx16 -msahf -msse4.1 --param l1-cache-size=32 --param l1-cache-line-size=64 --param l2-cache-size=6144 -O2 -pipe", which are visible. I spotted some flags succeeding it. One was -fno-omit-frame-pointer, which is important for debugging on x86, but is not quite so important on amd64. Another is -O3, which does not make sense to me at all. There is no custom-cflags USE flag, so the build system should not be picking its own O level. Lastly, I see that -m64 is being specified twice, which is not a problem per se, but it could be indicator that the build system has design issues, which would be something that needs to be corrected.
Comment 1 Vlastimil Babka (Caster) (RETIRED) gentoo-dev 2011-03-02 13:15:02 UTC
Andrew: can you comment on whether icedtea could respect CFLAGS or it would break it etc?
Comment 2 Agostino Sarubbo gentoo-dev 2011-08-26 14:56:30 UTC
If you guess, that without -O3 the code is broken, please drop -g -pipe at least.
Comment 3 Andrew John Hughes 2015-03-22 22:29:04 UTC
"-march=core2 -mtune=core2 -mcx16 -msahf -msse4.1"

^ That must be coming from you, right?

So what you're saying is not that CFLAGS aren't being honoured at all, but that you want them to override the main ones used by the build?
Comment 4 Rick Farina (Zero_Chaos) gentoo-dev 2015-03-23 01:44:45 UTC
(In reply to Andrew John Hughes from comment #3)
> "-march=core2 -mtune=core2 -mcx16 -msahf -msse4.1"
> 
> ^ That must be coming from you, right?
> 
> So what you're saying is not that CFLAGS aren't being honoured at all, but
> that you want them to override the main ones used by the build?

In general, the CFLAGS from the environment should be respected and used for all builds.  If a certain (limited) set of cflags is known broken, we can easily handle them with filter-flags or replace-flags from flag-o-matic.eclass.  If it is truly undesirable for this behavior to occur, typically user cflags are still respected with USE=custom-cflags and ignored otherwise and the users get to keep the pieces when it breaks.
Comment 5 Arfrever Frehtes Taifersar Arahesis 2015-05-16 12:31:46 UTC
Warning from emerge for dev-java/icedtea-7.2.5.5:

 * QA Notice: Files built without respecting CFLAGS have been detected
 *  Please include the following list of files in your report:
 * /usr/lib64/icedtea7/bin/jsadebugd
 * /usr/lib64/icedtea7/bin/pack200
 * /usr/lib64/icedtea7/bin/jarsigner
 * /usr/lib64/icedtea7/bin/jstat
 * /usr/lib64/icedtea7/bin/jstatd
 * /usr/lib64/icedtea7/bin/jdb
 * /usr/lib64/icedtea7/bin/java
 * /usr/lib64/icedtea7/bin/rmic
 * /usr/lib64/icedtea7/bin/orbd
 * /usr/lib64/icedtea7/bin/javap
 * /usr/lib64/icedtea7/bin/keytool
 * /usr/lib64/icedtea7/bin/jmap
 * /usr/lib64/icedtea7/bin/native2ascii
 * /usr/lib64/icedtea7/bin/jps
 * /usr/lib64/icedtea7/bin/jrunscript
 * /usr/lib64/icedtea7/bin/wsimport
 * /usr/lib64/icedtea7/bin/xjc
 * /usr/lib64/icedtea7/bin/serialver
 * /usr/lib64/icedtea7/bin/wsgen
 * /usr/lib64/icedtea7/bin/javah
 * /usr/lib64/icedtea7/bin/javac
 * /usr/lib64/icedtea7/bin/schemagen
 * /usr/lib64/icedtea7/bin/jhat
 * /usr/lib64/icedtea7/bin/rmid
 * /usr/lib64/icedtea7/bin/rmiregistry
 * /usr/lib64/icedtea7/bin/jconsole
 * /usr/lib64/icedtea7/bin/apt
 * /usr/lib64/icedtea7/bin/servertool
 * /usr/lib64/icedtea7/bin/policytool
 * /usr/lib64/icedtea7/bin/extcheck
 * /usr/lib64/icedtea7/bin/jinfo
 * /usr/lib64/icedtea7/bin/jstack
 * /usr/lib64/icedtea7/bin/appletviewer
 * /usr/lib64/icedtea7/bin/idlj
 * /usr/lib64/icedtea7/bin/jar
 * /usr/lib64/icedtea7/bin/unpack200
 * /usr/lib64/icedtea7/bin/jcmd
 * /usr/lib64/icedtea7/bin/javadoc
 * /usr/lib64/icedtea7/bin/tnameserv
 * /usr/lib64/icedtea7/lib/jexec
 * /usr/lib64/icedtea7/lib/amd64/jli/libjli.so
 * /usr/lib64/icedtea7/jre/bin/pack200
 * /usr/lib64/icedtea7/jre/bin/java
 * /usr/lib64/icedtea7/jre/bin/orbd
 * /usr/lib64/icedtea7/jre/bin/keytool
 * /usr/lib64/icedtea7/jre/bin/rmid
 * /usr/lib64/icedtea7/jre/bin/rmiregistry
 * /usr/lib64/icedtea7/jre/bin/servertool
 * /usr/lib64/icedtea7/jre/bin/policytool
 * /usr/lib64/icedtea7/jre/bin/unpack200
 * /usr/lib64/icedtea7/jre/bin/tnameserv
 * /usr/lib64/icedtea7/jre/lib/jexec
 * /usr/lib64/icedtea7/jre/lib/amd64/libnpt.so
 * /usr/lib64/icedtea7/jre/lib/amd64/libj2pcsc.so
 * /usr/lib64/icedtea7/jre/lib/amd64/libfontmanager.so
 * /usr/lib64/icedtea7/jre/lib/amd64/libinstrument.so
 * /usr/lib64/icedtea7/jre/lib/amd64/libverify.so
 * /usr/lib64/icedtea7/jre/lib/amd64/libjava_crw_demo.so
 * /usr/lib64/icedtea7/jre/lib/amd64/libjsoundalsa.so
 * /usr/lib64/icedtea7/jre/lib/amd64/libmanagement.so
 * /usr/lib64/icedtea7/jre/lib/amd64/libawt.so
 * /usr/lib64/icedtea7/jre/lib/amd64/libjavagtk.so
 * /usr/lib64/icedtea7/jre/lib/amd64/libzip.so
 * /usr/lib64/icedtea7/jre/lib/amd64/libjdwp.so
 * /usr/lib64/icedtea7/jre/lib/amd64/libjsound.so
 * /usr/lib64/icedtea7/jre/lib/amd64/libhprof.so
 * /usr/lib64/icedtea7/jre/lib/amd64/libjsig.so
 * /usr/lib64/icedtea7/jre/lib/amd64/libsctp.so
 * /usr/lib64/icedtea7/jre/lib/amd64/xawt/libmawt.so
 * /usr/lib64/icedtea7/jre/lib/amd64/libjsdt.so
 * /usr/lib64/icedtea7/jre/lib/amd64/libj2pkcs11.so
 * /usr/lib64/icedtea7/jre/lib/amd64/libjaas_unix.so
 * /usr/lib64/icedtea7/jre/lib/amd64/libj2gss.so
 * /usr/lib64/icedtea7/jre/lib/amd64/libmlib_image.so
 * /usr/lib64/icedtea7/jre/lib/amd64/libjava.so
 * /usr/lib64/icedtea7/jre/lib/amd64/libdt_socket.so
 * /usr/lib64/icedtea7/jre/lib/amd64/libsaproc.so
 * /usr/lib64/icedtea7/jre/lib/amd64/libnio.so
 * /usr/lib64/icedtea7/jre/lib/amd64/headless/libmawt.so
 * /usr/lib64/icedtea7/jre/lib/amd64/libjawt.so
 * /usr/lib64/icedtea7/jre/lib/amd64/libjavalcms.so
 * /usr/lib64/icedtea7/jre/lib/amd64/libunpack.so
 * /usr/lib64/icedtea7/jre/lib/amd64/jli/libjli.so
 * /usr/lib64/icedtea7/jre/lib/amd64/libattach.so
 * /usr/lib64/icedtea7/jre/lib/amd64/libjavajpeg.so
 * /usr/lib64/icedtea7/jre/lib/amd64/libnet.so
 * /usr/lib64/icedtea7/jre/lib/amd64/libsplashscreen.so
Comment 6 Arfrever Frehtes Taifersar Arahesis 2018-03-17 19:41:32 UTC
User-specified CFLAGS are now used in dev-java/icedtea-3.7.0, but there are some cases when -O3 (and -g) are passed after user-specified CFLAGS.