jdk8 extra c/cxx - flags settings
Baesken, Matthias
matthias.baesken at sap.com
Sat Nov 23 14:41:17 UTC 2013
Thanks for the hint, Dave .
But I think that it is not related to running configure twice , but to the different SetupNativeCompilation - calls of these generator in the GensrcMisc.gmk .
If you compare them to other native compilation like nio / net etc. , they usually set CFLAGS_JDKLIB or CFLAGS_JDKEXE in SetupNativeCompilation which include these extra-flags .
But the generators don't have this , for example :
jdk/makefiles/gensrc/GensrcMisc.gmk
$(eval $(call SetupNativeCompilation,BUILD_GENSRC_SOR_EXE, \
SRC := $(GENSRC_SOR_SRC), \
INCLUDE_FILES := $(GENSRC_SOR_SRC_FILE), \
LANG := C, \
CC := $(BUILD_CC), \
LDEXE := $(BUILD_LD), \
OBJECT_DIR := $(GENSRC_SOR_BIN), \
OUTPUT_DIR := $(GENSRC_SOR_BIN), \
PROGRAM := genSocketOptionRegistry))
So it is not a wonder that the added extra flags do not show up here .
This might be even a good idea in some cases, because the generators have different requirements for example when cross compiling.
But shouldn't there be then some other option to set extra flags for the generators ?
Regards, Matthias
-----Original Message-----
From: Dave Pointon [mailto:dpointo8 at linux.vnet.ibm.com]
Sent: Freitag, 22. November 2013 14:34
To: Baesken, Matthias
Cc: build-dev at openjdk.java.net
Subject: Re: jdk8 extra c/cxx - flags settings
Hi Matthias ,
On Fri, 2013-11-22 at 12:55 +0000, Baesken, Matthias wrote:
> I had the need for setting additional C/C++ compilation flags in my OpenJDK8 build.
> It seems they are used for most jdk C/C++ compilation, but at least the generators from
>
> jdk/makefiles/gensrc/GensrcMisc.gmk
>
> seem to be an exception.
>
> Example :
>
> configure --with-extra-cflags=-DTESTMYEXTRAFLAGC --with-extra-cxxflags=-DTESTMYEXTRAFLAGCXX
>
> does not lead to the expected flags in the build for genSocketOptionRegistry.c :
>
> ...
> /usr/local/bin/gcc -DTHIS_FILE='"genSocketOptionRegistry.c"' -c -MMD -MF /mydir/open_jdk/jdk8/linuxx86_64_opt/jdk/gensrc/genSocketOptionRegistry/genSocketOptionRegistry.d
> -o /mydir/open_jdk/jdk8/linuxx86_64_opt/jdk/gensrc/genSocketOptionRegistry/genSocketOptionRegistry.o /mydir/open_jdk/jdk8/openjdk8/jdk/src/share/native/sun/nio/ch/genSocketOptionRegistry.c
> ...
>
> (while the flags show up for "normal" C/C++ files .)
>
> Is there another option (available / planned?) to configure the extra C/C++ compile flags for this special case ?
>
>
> Thanks,
> Matthias
>
I don't know if it's of any help, but I've noticed that configure
sometimes needs to be run twice before the additional/new/modified
option(s) take effect - quite frequently, the first time is merely a
re-run of the previously generated generated-configure.sh.
HTH ,
Rgds ,
--
Dave Pointon FIAP MBCS
Now I saw, tho' too late, the folly of beginning a work
before we count the cost and before we we judge rightly
of our strength to go thro' with it - Robinson Crusoe
More information about the build-dev
mailing list