Request for review: support building hotspot with gcc 4.6

David Katleman david.katleman at oracle.com
Fri Apr 29 23:13:17 UTC 2011


Hi Omair!

On 4/29/2011 3:59 PM, Omair Majid wrote:
> Hi,
>
> http://cr.openjdk.java.net/~omajid/webrevs/gcc-46-support/
>
> The patch adds support for building hotspot with gcc 4.6. gcc 4.6 
> changed how arguments are handled. It now treats -export-dynamic as it 
> treats any other -efoo option: it thinks xport-dynamic is the entry 
> point and passes this information to the linker. Since -export-dynamic 
> is not passed to the linker, not all symbols will be exported by the 
> linker. The bfd-based linker, given the invalid entry point 
> xport-dynamic, simply ignores it. The gold linker, however, crashes 
> causing the build to fail.
>
> Since -export-dynamic is a linker option, the correct way to pass it 
> is using -Wl,-export-dynamic (or -Xlinker -export-dynamic). We have 
> had this patch in IcedTea6 for a while now, but it would be nice if 
> this was in OpenJDK too.

Seems like your change should be surrounded by an ifneq that enables 
your change for 4.6 and later

Example elsewhere in the file

>   129 # Except for a few acceptable ones
>   130 # Since GCC 4.3, -Wconversion has changed its meanings to warn these implicit
>   131 # conversions which might affect the values. To avoid that, we need to turn
>   132 # it off explicitly.
>   133 ifneq "$(shell expr \( $(CC_VER_MAJOR) \>  4 \) \| \( \( $(CC_VER_MAJOR) = 4 \) \&  \( $(CC_VER_MINOR) \>= 3 \) \))" "0"
>   134 ACCEPTABLE_WARNINGS = -Wpointer-arith -Wsign-compare
>   135 else
>   136 ACCEPTABLE_WARNINGS = -Wpointer-arith -Wconversion -Wsign-compare
>   137 endif

Thanks
         Dave




More information about the build-dev mailing list