Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 770217 - dev-java/openjdk-11.0.10_p9 with -std=c++17: error: left operand of shift expression '(-1 << 13)' is negative
Summary: dev-java/openjdk-11.0.10_p9 with -std=c++17: error: left operand of shift exp...
Status: RESOLVED INVALID
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Georgy Yakovlev
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-02-12 15:16 UTC by Helmut Jarausch
Modified: 2023-07-27 19:45 UTC (History)
2 users (show)

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


Attachments
emerge --info output (INFO,22.64 KB, text/plain)
2021-02-12 15:16 UTC, Helmut Jarausch
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Helmut Jarausch 2021-02-12 15:16:20 UTC
Created attachment 686475 [details]
emerge --info output

It fails with
if [ -n "`/usr/bin/x86_64-pc-linux-gnu-nm /var/tmp/portage/dev-java/openjdk-11.0.10_p9/work/jdk11u-jdk-11.0.10-ga/build/linux-x86_64-normal-server-release/hotspot/variant-server/libjvm/objs/abstractCompiler.o | /bin/grep -e _ZdaPv -e _ZdlPv -e _Znam -e _Znwm | /bin/grep ' U '`" ]; 
then /bin/echo "/var/tmp/portage/dev-java/openjdk-11.0.10_p9/work/jdk11u-jdk-11.0.10-ga/build/linux-x86_64-normal-server-release/hotspot/variant-server/libjvm/objs/abstractCompiler.o: 
Error: Use of global operators new and delete is not allowed in Hotspot:"; /usr/bin/x86_64-pc-linux-gnu-nm /var/tmp/portage/dev-java/openjdk-11.0.10_p9/work/jdk11u-jdk-11.0.10-ga/build/linux-x86_64-normal-server-release/hotspot/variant-server/libjvm/objs/abstractCompiler.o | /usr/bin/x86_64-pc-linux-gnu-c++filt | /bin/grep -E '[^:]operator (new|delete)' | /bin/grep ' U '; /bin/echo "See: /var/tmp/portage/dev-java/openjdk-11.0.10_p9/work/jdk11u-jdk-11.0.10-ga/make/hotspot/lib/CompileJvm.gmk"; exit 1; fi
Comment 1 Ionen Wolkens gentoo-dev 2021-02-12 20:12:42 UTC
Unfortunately that's not the error, I'd ask for build.log but I imagine it's the same as in your report from last year that was missing the opposite bit of information (having both is useful).

---
/var/tmp/portage/dev-java/openjdk-11.0.8_p10/work/jdk11u-jdk-11.0.8-ga/src/jdk.pack/share/native/common-unpack/constants.h:206:37: error: left operand of shift expression '(-1 << 13)' is negative [-fpermissive]
  206 |     AO_UNUSED_MBZ             = (-1)<<13, // options bits reserved for future use.
      |                                 ~~~~^~~~
/var/tmp/portage/dev-java/openjdk-11.0.8_p10/work/jdk11u-jdk-11.0.8-ga/src/jdk.pack/share/native/common-unpack/constants.h:206:39: error: enumerator value for 'AO_UNUSED_MBZ' is not an integer constant
  206 |     AO_UNUSED_MBZ             = (-1)<<13, // options bits reserved for future use.
---

Looking at your CXXFLAGS that's caused by -std=c++17 (can reproduce), so try removing it. I don't recommend to set this globally.

This would normally cause failure with gcc11 as well (which uses c++17 by default) but the problem is that option is being overridden:
-std=gnu++98 -m64 -march=native -O2 -std=c++17

Guess(?) ebuild could strip the option if fixing this is wanted.
Comment 2 Helmut Jarausch 2021-02-13 11:47:01 UTC
(In reply to Ionen Wolkens from comment #1)
> Unfortunately that's not the error, I'd ask for build.log but I imagine it's
> the same as in your report from last year that was missing the opposite bit
> of information (having both is useful).
> 
> ---
> /var/tmp/portage/dev-java/openjdk-11.0.8_p10/work/jdk11u-jdk-11.0.8-ga/src/
> jdk.pack/share/native/common-unpack/constants.h:206:37: error: left operand
> of shift expression '(-1 << 13)' is negative [-fpermissive]
>   206 |     AO_UNUSED_MBZ             = (-1)<<13, // options bits reserved
> for future use.
>       |                                 ~~~~^~~~
> /var/tmp/portage/dev-java/openjdk-11.0.8_p10/work/jdk11u-jdk-11.0.8-ga/src/
> jdk.pack/share/native/common-unpack/constants.h:206:39: error: enumerator
> value for 'AO_UNUSED_MBZ' is not an integer constant
>   206 |     AO_UNUSED_MBZ             = (-1)<<13, // options bits reserved
> for future use.
> ---
> 
> Looking at your CXXFLAGS that's caused by -std=c++17 (can reproduce), so try
> removing it. I don't recommend to set this globally.
> 
> This would normally cause failure with gcc11 as well (which uses c++17 by
> default) but the problem is that option is being overridden:
> -std=gnu++98 -m64 -march=native -O2 -std=c++17
> 
> Guess(?) ebuild could strip the option if fixing this is wanted.

Yes, thanks, it was the C++17 flag. C++20 is ante portas.
Comment 3 Andrew John Hughes 2021-02-14 02:10:44 UTC
Yes, it would make sense for the ebuild to strip this flag.

11u is a legacy JDK and I don't see us accepting patches to make the code work with C++ standards that are little older than the JDK itself (11u was released on 2018-09-25)
Comment 4 Ionen Wolkens gentoo-dev 2021-02-14 14:57:35 UTC
Leaving this open for maintainers to decide instead.
Comment 5 Georgy Yakovlev archtester gentoo-dev 2021-08-05 07:56:07 UTC
those flags are not supposed to be set by users.
project determines standard it adheres to, not user.
I don't think we should filter that flag either, it's incorrect configuration, can't prevent all of it.
closing.

please do not use -std in CXXFLAGS =)