pmqs / DB_File

DB_File - Perl5 access to Berkeley DB version 1.x
7 stars 3 forks source link

DB_File-1.858 does not build on Rocky Linux 8.8 (aarch64) #12

Open rmarable opened 11 months ago

rmarable commented 11 months ago

DB_File-1.858 does not build on Rocky Linux 8.8 due to an error caused by an unknown architectural extension called ssbs when compiled with GCC-12.2.0 on an AWS c6g-class instance.

This doesn't seem to be an issue for x86_64.

Any insights you could offer would be appreciated.

$ cpanm DB_File
--> Working on DB_File
Fetching http://www.cpan.org/authors/id/P/PM/PMQS/DB_File-1.858.tar.gz ... OK
Configuring DB_File-1.858 ... OK
Building and testing DB_File-1.858 ... FAIL
! Installing DB_File failed. See /build/rocky8_arm64/.cpanm/work/1691521891.3090198/build.log for details. Retry with --force to force install it.

Here the logs.

$ cat /build/rocky8_arm64/.cpanm/work/1691522214.3090269/build.log
cpanm (App::cpanminus) 1.7046 on perl 5.036000 built for aarch64-linux-thread-multi
Work directory is /build/rocky8_arm64/.cpanm/work/1691522214.3090269
You have make /usr/bin/make
You have LWP 6.67
You have /usr/bin/tar: tar (GNU tar) 1.30
Copyright (C) 2017 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Written by John Gilmore and Jay Fenlason.
You have /usr/bin/unzip
Searching DB_File () on cpanmetadb ...
--> Working on DB_File
Fetching http://www.cpan.org/authors/id/P/PM/PMQS/DB_File-1.858.tar.gz
-> OK
Unpacking DB_File-1.858.tar.gz
Entering DB_File-1.858
Checking configure dependencies from META.json
Checking if you have ExtUtils::MakeMaker 6.58 ... Yes (7.64)
Configuring DB_File-1.858
Running Makefile.PL
Parsing config.in...
Looks Good.
Checking if your kit is complete...
Looks good
Generating a Unix-style Makefile
Writing Makefile for DB_File
Writing MYMETA.yml and MYMETA.json
-> OK
Checking dependencies from MYMETA.json ...
Checking if you have ExtUtils::MakeMaker 0 ... Yes (7.64)
Building and testing DB_File-1.858
cp DB_File.pm blib/lib/DB_File.pm
Running Mkbootstrap for DB_File ()
chmod 644 "DB_File.bs"
"/build/rocky8_arm64/software/Perl/5.36.0-GCCcore-12.2.0/bin/perl" -MExtUtils::Command::MM -e 'cp_nonempty' -- DB_File.bs blib/arch/auto/DB_File/DB_File.bs 644
gcc -c  -I/usr/local/BerkeleyDB/include -D_REENTRANT -D_GNU_SOURCE -O2 -ftree-vectorize -mcpu=native -fno-math-errno -fPIC -fwrapv -fno-strict-aliasing -pipe -fstack-protector-strong -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_FORTIFY_SOURCE=2 -O2   -DVERSION=\"1.858\" -DXS_VERSION=\"1.858\" -fPIC "-I/build/rocky8_arm64/software/Perl/5.36.0-GCCcore-12.2.0/lib/perl5/5.36.0/aarch64-linux-thread-multi/CORE"  -D_NOT_CORE  -DmDB_Prefix_t=size_t -DmDB_Hash_t=u_int32_t   version.c
Assembler messages:
Error: unknown architectural extension `ssbs'
Error: unrecognized option -march=armv8.2-a+crypto+fp16+rcpc+dotprod+ssbs
make: *** [Makefile:360: version.o] Error 2
-> FAIL Installing DB_File failed. See /build/rocky8_arm64/.cpanm/work/1691522214.3090269/build.log for details. Retry with --force to force install it.
pmqs commented 11 months ago

Hey @rmarable

First time I've seen a bug report from an ARM build of Perl. Also, that error message is new to me.

When the Perl binary is built it remembers the gcc settings used so that it can reuse them when building a module, like DB_File, that is partially written in C. Below is the gcc command line used when you built DB_File

gcc -c  -I/usr/local/BerkeleyDB/include -D_REENTRANT -D_GNU_SOURCE -O2 -ftree-vectorize -mcpu=native -fno-math-errno -fPIC -fwrapv -fno-strict-aliasing -pipe -fstack-protector-strong -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_FORTIFY_SOURCE=2 -O2   -DVERSION=\"1.858\" -DXS_VERSION=\"1.858\" -fPIC "-I/build/rocky8_arm64/software/Perl/5.36.0-GCCcore-12.2.0/lib/perl5/5.36.0/aarch64-linux-thread-multi/CORE"  -D_NOT_CORE  -DmDB_Prefix_t=size_t -DmDB_Hash_t=u_int32_t   version.c

The option that jumps out is -mcpu=native.

You could try removing that option to see if it helps. To do that download the DB_File tar bundle

wget https://cpan.metacpan.org/authors/id/P/PM/PMQS/DB_File-1.858.tar.gz
tar xvf DB_File-1.858.tar.gz
cd DB_File-1.858
perl Makefile.PL

Now edit the generated Makefile and delete -mcpu=native. Then run make test .

Does that make any difference?

pmqs commented 10 months ago

@rmarable any updates on this issue?