Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 697034 - dev-libs/crypto++-8.2.0 - donna_64.cpp:1388:67: error: invalid types ‘CryptoPP::Donna::Arch64::ge25519_pniels [8][__gnu_cxx::__enable_if<true, double>::__type {aka double}]’ for array subscript
Summary: dev-libs/crypto++-8.2.0 - donna_64.cpp:1388:67: error: invalid types ‘CryptoP...
Status: RESOLVED TEST-REQUEST
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: x86 Linux
: Normal normal
Assignee: Sam James
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-10-09 04:59 UTC by david
Modified: 2020-12-25 23:33 UTC (History)
2 users (show)

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


Attachments
ebuild environment and info (ebuild_info_and_env.txt,81.15 KB, text/plain)
2019-10-09 04:59 UTC, david
Details

Note You need to log in before you can comment on or make changes to this bug.
Description david 2019-10-09 04:59:01 UTC
Created attachment 592270 [details]
ebuild environment and info

when running emerge --ask --oneshot =dev-libs/crypto++-8.2.0:

 * Package:    dev-libs/crypto++-8.2.0
 * Repository: gentoo
 * Maintainer: crypto@gentoo.org noloader@gmail.com
 * USE:        abi_x86_64 amd64 asm elibc_glibc kernel_linux userland_GNU
 * FEATURES:   preserve-libs sandbox userpriv usersandbox
>>> Unpacking source...
>>> Unpacking cryptopp820.zip to /var/tmp/portage/dev-libs/crypto++-8.2.0/work
>>> Source unpacked in /var/tmp/portage/dev-libs/crypto++-8.2.0/work
>>> Preparing source in /var/tmp/portage/dev-libs/crypto++-8.2.0/work ...
 * Applying crypto++-8.2.0-build.patch ...                                                                                                              [ ok ]
>>> Source prepared.
>>> Configuring source in /var/tmp/portage/dev-libs/crypto++-8.2.0/work ...
>>> Source configured.
>>> Compiling source in /var/tmp/portage/dev-libs/crypto++-8.2.0/work ...
make -j4 -f GNUmakefile all shared libcryptopp.pc 
Using testing flags: -march=broadwell -O2 -pipe
x86_64-pc-linux-gnu-g++ -march=broadwell -O2 -pipe -fPIC -pthread -pipe -c cryptlib.cpp
x86_64-pc-linux-gnu-g++ -march=broadwell -O2 -pipe -fPIC -pthread -pipe -c cpu.cpp
x86_64-pc-linux-gnu-g++ -march=broadwell -O2 -pipe -fPIC -pthread -pipe -c integer.cpp
x86_64-pc-linux-gnu-g++ -march=broadwell -O2 -pipe -fPIC -pthread -pipe -c 3way.cpp
x86_64-pc-linux-gnu-g++ -march=broadwell -O2 -pipe -fPIC -pthread -pipe -c adler32.cpp
x86_64-pc-linux-gnu-g++ -march=broadwell -O2 -pipe -fPIC -pthread -pipe -c algebra.cpp
x86_64-pc-linux-gnu-g++ -march=broadwell -O2 -pipe -fPIC -pthread -pipe -c algparam.cpp
x86_64-pc-linux-gnu-g++ -march=broadwell -O2 -pipe -fPIC -pthread -pipe -c arc4.cpp
x86_64-pc-linux-gnu-g++ -march=broadwell -O2 -pipe -fPIC -pthread -pipe -c aria.cpp
x86_64-pc-linux-gnu-g++ -march=broadwell -O2 -pipe -fPIC -pthread -pipe -mssse3 -c aria_simd.cpp
x86_64-pc-linux-gnu-g++ -march=broadwell -O2 -pipe -fPIC -pthread -pipe -c ariatab.cpp
x86_64-pc-linux-gnu-g++ -march=broadwell -O2 -pipe -fPIC -pthread -pipe -c asn.cpp
x86_64-pc-linux-gnu-g++ -march=broadwell -O2 -pipe -fPIC -pthread -pipe -c authenc.cpp
x86_64-pc-linux-gnu-g++ -march=broadwell -O2 -pipe -fPIC -pthread -pipe -c base32.cpp
x86_64-pc-linux-gnu-g++ -march=broadwell -O2 -pipe -fPIC -pthread -pipe -c base64.cpp
x86_64-pc-linux-gnu-g++ -march=broadwell -O2 -pipe -fPIC -pthread -pipe -c basecode.cpp
x86_64-pc-linux-gnu-g++ -march=broadwell -O2 -pipe -fPIC -pthread -pipe -c bfinit.cpp
x86_64-pc-linux-gnu-g++ -march=broadwell -O2 -pipe -fPIC -pthread -pipe -c blake2.cpp
x86_64-pc-linux-gnu-g++ -march=broadwell -O2 -pipe -fPIC -pthread -pipe -msse4.1 -c blake2b_simd.cpp
x86_64-pc-linux-gnu-g++ -march=broadwell -O2 -pipe -fPIC -pthread -pipe -msse4.1 -c blake2s_simd.cpp
x86_64-pc-linux-gnu-g++ -march=broadwell -O2 -pipe -fPIC -pthread -pipe -c blowfish.cpp
x86_64-pc-linux-gnu-g++ -march=broadwell -O2 -pipe -fPIC -pthread -pipe -c blumshub.cpp
x86_64-pc-linux-gnu-g++ -march=broadwell -O2 -pipe -fPIC -pthread -pipe -c camellia.cpp
x86_64-pc-linux-gnu-g++ -march=broadwell -O2 -pipe -fPIC -pthread -pipe -c cast.cpp
x86_64-pc-linux-gnu-g++ -march=broadwell -O2 -pipe -fPIC -pthread -pipe -c casts.cpp
x86_64-pc-linux-gnu-g++ -march=broadwell -O2 -pipe -fPIC -pthread -pipe -c cbcmac.cpp
x86_64-pc-linux-gnu-g++ -march=broadwell -O2 -pipe -fPIC -pthread -pipe -c ccm.cpp
x86_64-pc-linux-gnu-g++ -march=broadwell -O2 -pipe -fPIC -pthread -pipe -c chacha.cpp
x86_64-pc-linux-gnu-g++ -march=broadwell -O2 -pipe -fPIC -pthread -pipe -mavx2 -c chacha_avx.cpp
x86_64-pc-linux-gnu-g++ -march=broadwell -O2 -pipe -fPIC -pthread -pipe -msse2 -c chacha_simd.cpp
x86_64-pc-linux-gnu-g++ -march=broadwell -O2 -pipe -fPIC -pthread -pipe -c chachapoly.cpp
x86_64-pc-linux-gnu-g++ -march=broadwell -O2 -pipe -fPIC -pthread -pipe -c cham.cpp
x86_64-pc-linux-gnu-g++ -march=broadwell -O2 -pipe -fPIC -pthread -pipe -mssse3 -c cham_simd.cpp
x86_64-pc-linux-gnu-g++ -march=broadwell -O2 -pipe -fPIC -pthread -pipe -c channels.cpp
x86_64-pc-linux-gnu-g++ -march=broadwell -O2 -pipe -fPIC -pthread -pipe -c cmac.cpp
x86_64-pc-linux-gnu-g++ -march=broadwell -O2 -pipe -fPIC -pthread -pipe -c crc.cpp
x86_64-pc-linux-gnu-g++ -march=broadwell -O2 -pipe -fPIC -pthread -pipe -msse4.2 -c crc_simd.cpp
x86_64-pc-linux-gnu-g++ -march=broadwell -O2 -pipe -fPIC -pthread -pipe -c darn.cpp
x86_64-pc-linux-gnu-g++ -march=broadwell -O2 -pipe -fPIC -pthread -pipe -c default.cpp
x86_64-pc-linux-gnu-g++ -march=broadwell -O2 -pipe -fPIC -pthread -pipe -c des.cpp
x86_64-pc-linux-gnu-g++ -march=broadwell -O2 -pipe -fPIC -pthread -pipe -c dessp.cpp
x86_64-pc-linux-gnu-g++ -march=broadwell -O2 -pipe -fPIC -pthread -pipe -c dh.cpp
x86_64-pc-linux-gnu-g++ -march=broadwell -O2 -pipe -fPIC -pthread -pipe -c dh2.cpp
x86_64-pc-linux-gnu-g++ -march=broadwell -O2 -pipe -fPIC -pthread -pipe -c dll.cpp
x86_64-pc-linux-gnu-g++ -march=broadwell -O2 -pipe -fPIC -pthread -pipe -c donna_32.cpp
x86_64-pc-linux-gnu-g++ -march=broadwell -O2 -pipe -fPIC -pthread -pipe -c donna_64.cpp
x86_64-pc-linux-gnu-g++ -march=broadwell -O2 -pipe -fPIC -pthread -pipe -msse2 -c donna_sse.cpp
x86_64-pc-linux-gnu-g++ -march=broadwell -O2 -pipe -fPIC -pthread -pipe -c dsa.cpp
donna_64.cpp: In function ‘void CryptoPP::Donna::Ed25519::{anonymous}::ge25519_double_scalarmult_vartime(CryptoPP::Donna::Arch64::ge25519*, const CryptoPP::Donna::Arch64::ge25519*, const bignum256modm_element_t*, const bignum256modm_element_t*)’:
donna_64.cpp:1388:67: error: invalid types ‘CryptoPP::Donna::Arch64::ge25519_pniels [8][__gnu_cxx::__enable_if<true, double>::__type {aka double}]’ for array subscript
             ge25519_pnielsadd_p1p1(&t, r, &pre1[abs(slide1[i]) / 2], (byte)slide1[i] >> 7);
                                                                   ^
donna_64.cpp:1393:94: error: invalid types ‘const CryptoPP::Donna::Arch64::ge25519_niels [32][__gnu_cxx::__enable_if<true, double>::__type {aka double}]’ for array subscript
             ge25519_nielsadd2_p1p1(&t, r, &ge25519_niels_sliding_multiples[abs(slide2[i]) / 2], (byte)slide2[i] >> 7);
                                                                                              ^
make: *** [GNUmakefile:1589: donna_64.o] Error 1
make: *** Waiting for unfinished jobs....
 * ERROR: dev-libs/crypto++-8.2.0::gentoo failed (compile phase):
 *   emake failed
 * 
 * If you need support, post the output of `emerge --info '=dev-libs/crypto++-8.2.0::gentoo'`,
 * the complete build log and the output of `emerge -pqv '=dev-libs/crypto++-8.2.0::gentoo'`.
 * The complete build log is located at '/var/tmp/portage/dev-libs/crypto++-8.2.0/temp/build.log'.
 * The ebuild environment file is located at '/var/tmp/portage/dev-libs/crypto++-8.2.0/temp/environment'.
 * Working directory: '/var/tmp/portage/dev-libs/crypto++-8.2.0/work'
 * S: '/var/tmp/portage/dev-libs/crypto++-8.2.0/work'
Comment 1 Jeffrey Walton 2019-10-09 09:00:04 UTC
>>>>>>>>>> SNIP <<<<<<<<<<
donna_64.cpp: In function ‘void CryptoPP::Donna::Ed25519::{anonymous}::ge25519_double_scalarmult_vartime(CryptoPP::Donna::Arch64::ge25519*, const CryptoPP::Donna::Arch64::ge25519*, const bignum256modm_element_t*, const bignum256modm_element_t*)’:
donna_64.cpp:1388:67: error: invalid types ‘CryptoPP::Donna::Arch64::ge25519_pniels [8][__gnu_cxx::__enable_if<true, double>::__type {aka double}]’ for array subscript
             ge25519_pnielsadd_p1p1(&t, r, &pre1[abs(slide1[i]) / 2], (byte)slide1[i] >> 7);

Thanks David.

I'm having trouble duplicating the issue with Master and a CRYPTOPP_8_2_0 checkout:

  CXXFLAGS="-march=broadwell -O2" make -j 8

I'm on a different platform, though. I don't have a Gentoo test machine at the moment. I'm using Ubuntu with GCC 7.4.0 and Fedora with GCC 9.2.1.

I'm not sure about this message:

donna_64.cpp:1388:67: error: invalid types 
Donna::Arch64::ge25519_pniels [8][__gnu_cxx::__enable_if<true, double>::__type {aka double}]’ for array subscript

I believe it is coming from:

  #define S1_SWINDOWSIZE 5
  #define S1_TABLE_SIZE (1<<(S1_SWINDOWSIZE-2))

(S1_TABLE_SIZE takes the value of 8).

And then in ge25519_double_scalarmult_vartime:

  ge25519_pniels pre1[S1_TABLE_SIZE];

Going back a little further in donna_64.h:

  typedef word64 bignum25519[5];

  struct ge25519_pniels {
    bignum25519 ysubx, xaddy, z, t2d;
  };

I don't see anything out of the ordinary, except word64 is typedef'd as 'unsigned long' under LP64 data models (instead of a double). Do you know why the compiler is trying to use a double there?

What compiler is x86_64-pc-linux-gnu-g++? What do you know about it?
Comment 2 david 2020-12-23 06:45:47 UTC
i don't really know whats up with that compiler. i tried to track down whats up with it and here's what i was able to find.

/usr/x86_64-pc-linux-gnu/gcc-bin/9.3.0/x86_64-pc-linux-gnu-g++ --version
x86_64-pc-linux-gnu-g++ (Gentoo 9.3.0-r1 p3) 9.3.0
Copyright (C) 2019 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

my impression is that it's gnu g++ 9.3.0?
Comment 3 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2020-12-25 23:33:00 UTC
(In reply to david from comment #2)
> i don't really know whats up with that compiler. i tried to track down whats
> up with it and here's what i was able to find.
> 
> /usr/x86_64-pc-linux-gnu/gcc-bin/9.3.0/x86_64-pc-linux-gnu-g++ --version
> x86_64-pc-linux-gnu-g++ (Gentoo 9.3.0-r1 p3) 9.3.0
> Copyright (C) 2019 Free Software Foundation, Inc.
> This is free software; see the source for copying conditions.  There is NO
> warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
> 
> my impression is that it's gnu g++ 9.3.0?

yeah, it's just an extended name for that. Can you try with crypto++-8.3.0?