Reputation: 133
OS: Ubuntu 16.04 s390x
Gcc: Build from source v7.3.0 using steps mentioned below:
mkdir gcc
cd gcc
wget https://ftpmirror.gnu.org/gcc/gcc-7.3.0/gcc-7.3.0.tar.xz
tar -xf gcc-7.3.0.tar.xz
cd gcc-7.3.0
./contrib/download_prerequisites
mkdir objdir
cd objdir
../configure --prefix=/opt/gcc --enable-languages=c,c++ --enable-shared --with-system-zlib --enable-threads=posix --enable-__cxa_atexit --enable-checking --enable-gnu-indirect-function --disable-bootstrap --disable-multilib
make
make install
ln -sf /opt/gcc/bin/gcc /usr/bin/gcc
ln -sf /opt/gcc/bin/g++ /usr/bin/g++
ln -sf /opt/gcc/bin/g++ /usr/bin/c++
export PATH=/opt/gcc/bin:"$PATH"
export LD_LIBRARY_PATH=/opt/gcc/lib64:"$LD_LIBRARY_PATH"
export C_INCLUDE_PATH=/opt/gcc/lib/gcc/s390x-linux-gnu/7.3.0/include
export CPLUS_INCLUDE_PATH=/opt/gcc/lib/gcc/s390x-linux-gnu/7.3.0/include
sudo ln -sf /opt/gcc/lib64/libstdc++.so.6.0.24 /usr/lib/s390x-linux-gnu/libstdc++.so.6
gcc --version
gcc (GCC) 7.3.0
Copyright (C) 2017 Free Software Foundation, Inc.
Then on compiling code for cockroachDB using make. Build fails with an error:
Error: invalid switch -march=z14
Error: unrecognized option -march=z14
Is there any flag which needs to enable here?
(No such error was observed if gcc is installed from repo using apt-get install g++-7 on Ubuntu 18.04)
Upvotes: 2
Views: 381
Reputation: 33717
-march-z14
was added after the GCC 7 release to GCC 8 in this commit and to GCC 7 in this commit. This commit went into the GCC 7.2 minor release, as far as I can tell, so GCC 7.3 should have it.
The error message is not a GCC error message, though. (Only code in the Ada front end calls command line option “switches”.) The build process uses something else from the Ubuntu 16.04 system which does not recognize -march=z14
.
You may be able to use march=arch12
as a workaround. (The 12
refers to the edition of the Principles of Operation, which is currently off by two.)
Upvotes: 2