What is --without-x option for? - gcc

I have a gcc compiler v 4.2.2 with next build options :
$ /opt/eldk-4.2/usr/bin/ppc_6xx-gcc -v
Reading specs from /home/dejovivl/workspace/eldk-4.2/usr/bin/../lib/gcc/powerpc-linux/4.2.2/specs
Target: powerpc-linux
Configured with: /opt/eldk/build/ppc-2008-04-01/work/usr/src/denx/BUILD/crosstool-0.43/build/gcc-4.2.2-glibc-20070515T2025-eldk/powerpc-linux/gcc-4.2.2/configure --target=powerpc-linux --host=i686-host_pc-linux-gnu --prefix=/var/tmp/eldk.UZpAG7/usr/crosstool/gcc-4.2.2-glibc-20070515T2025-eldk/powerpc-linux --disable-hosted-libstdcxx --with-headers=/var/tmp/eldk.UZpAG7/usr/crosstool/gcc-4.2.2-glibc-20070515T2025-eldk/powerpc-linux/powerpc-linux/include --with-local-prefix=/var/tmp/eldk.UZpAG7/usr/crosstool/gcc-4.2.2-glibc-20070515T2025-eldk/powerpc-linux/powerpc-linux --disable-nls --enable-threads=posix --enable-symvers=gnu --enable-__cxa_atexit --enable-languages=c,c++,java --enable-shared --enable-c99 --enable-long-long --without-x
Thread model: posix
gcc version 4.2.2
Most options are easy to find, except for --without-x. So, what is this option for?
The summary of gcc options didn't help, since the option is not listed.

Configure options are not options to gcc. They are given when gcc is built to the configure script. To find out what they mean, check the gcc source documentation.
If --with-x is not there, it doesn't have to mean anything, as autoconf-generated configure scripts can ignore flags.
However, it is listed on http://gcc.gnu.org/install/configure.html -
--with-x
Use the X Window System.

Related

Building gcc 11.2 with jit support requires GMP, MPFR, MPC, ISL recompiled with -fPIC

I'm on a CentOS 7 Linux system where I don't have the root access. So I have to build gcc from source. I want to build gcc 11.2 with the jit support. I invoked
contrib/download_prerequisites for GMP, MPFR, MPC and ISL. Then from a build directory I configured gcc using
../gcc-11.2.0/configure --prefix=/some/path --enable-bootstrap --enable-shared \
--enable-host-shared --enable-threads=posix --enable-languages=c,c++,jit \
--disable-multilib
then I hit make.
It failed with ld errors asking me to recompile libisl.a, libmpc.a, libmpfr.a, libgmp.a with -fPIC. Right before these errors I saw lots of jit related outputs. I assume jit is behind all of this?
Then I tried adding CFLAGS=-fPIC to the above configure command as ../gcc-11.2.0/configure CFLAGS=-fPIC *rest_of_the_options_above*. The same ld errors were emitted.
I'm aware that those dependencies each has --with-pic option to their own configure. But I'm wondering if there is a way to have gcc invoke that for me? If not, does it mean that to build gcc with jit support, one has to build the four dependencies manually with --with-pic? Thanks.

Why does armv7l-unknown-linux-gnueabihf-objdump give "invalid bfd target" when run?

I'm currently building Binutils 2.32 for the armv7l-unknown-linux-gnueabihf target, with this configure command:
chronos#localhost ~/Downloads/tarballs/binutils-2.32 $ ./configure --prefix=/usr/local/opt/arm-cross --target=armv7l-unknown-linux-gnueabihf --enable-shared --enable-host-shared --disable-static --enable-plugins --enable-gold=default --enable-ld --with-system-zlib
I ran make -j3 && make install, and no errors occured.
However, when I added /usr/local/opt/arm-cross/bin to my path and ran armv7l-unknown-linux-gnueabihf-objdump, this error occured:
armv7l-unknown-linux-gnueabihf-objdump: can't set BFD default target to `armv7l-unknown-linux-gnueabihf': invalid bfd target
How do I fix this? I searched on Stack Overflow and Google and couldn't come up with anything.
You configured with --enable-shared --enable-host-shared --disable-static. This means that it is you need to make sure that the binutils programs can find the shared objects they need. Therefore, in addition to PATH, you have to use LD_LIBRARY_PATH, or otherwise make the BFD library available to your custom binutils build.
This could however affect how other installed binutils versions find their BFD library, so it may be easier to link your version statically.

Custom built gcc 4.6.3 and gcc 5.4.0 include search list differs

I need to build some old gcc versions on Ubuntu 16. Primary goal is 4.6.3, but seems I have an include search list issue.
Builds using this compiler fail because sys/cdefs.h cannot be found. I have checked the include search paths for the compiler:
$ gcc -xc -E -v -
<…stripped…>
#include <...> search starts here:
<company specific path>/include
/usr/local/include
<company specific path>/include-fixed
/usr/include
End of search list.
I have also built gcc 5.4.0 with exactly the same build options. The search path looks like this for this version:
$ gcc -xc -E -v -
<…stripped…>
#include <...> search starts here:
<company specific path>/include
<company specific path>/include-fixed
/usr/local/include
/usr/include/x86_64-linux-gnu
/usr/include
End of search list.
Obviously the difference is /usr/include/x86_64-linux-gnu what is only present for 5.4.0. This is the dir where sys/cdefs.h resides.
Does anyone have any pointer what makes this difference? How could I build the 4.6.3 compiler to also have this path in the include search list?
I am of course aware of flags and env variables I can use to add this directory to the search path when using the compiler, but my goal would be to include this path in the compiler "hardcoded", so no additional -I and such flags should be used.
My gcc config options are:
configure --prefix=<company specific path>/gcc/4.6.3 --with-arch-32=i686
--with-sysroot=/ --with-multilib-list=m32,m64,mx32 --with-system-zlib
--enable-checking=release --build=x86_64-linux-gnu --enable-multilib
--enable-languages=c,c++,fortran
--with-as=<company specific path>/gcc/4.6.3/bin/as
--with-ld=<company specific path>/gcc/4.6.3/bin/ld
--with-gnu-as --with-gnu-ld

How to build multilib mingw-w64 gcc toolchain

I used to use MSVC a lot, and now I want to try out new C++17 features, so I decided to use mingw-w64 toolchian.
Btw I'm new to building things from source
I also want the ability to compile both 32 bit and 64 bit application (multilib).
I had mingw-w64 headers installed, then I tried to bootstrap GCC 7.1.0 in MSYS2.
I configured it by this command
../src/configure --enable-languages=c,c++ --build=x86_64-w64-mingw32 --host=x86_64-w64-mingw32 --target=x86_64-w64-mingw32 --enable-targets=all --disable-werror --prefix=/c/tmp/gcc/dest --with-sysroot=/c/tmp/gcc/dest --disable-shared --disable-win32-registry --enable-version-specific-runtime-libs
The process completed without an error, however the compiler isn't usable.
I tried to compile a file a.cpp by
g++ -o a.exe a.cpp
Unfortunately, a message box with title cc1plus appeared saying The code execution cannot proceed because libgcc_s_seh-1.dll was not found.
Reinstalling the program may fix this problem.
That suggested that I should have libgcc, but how can I get it?

What options should i use during gcc (mingw) configuration to build libstdc++.dll without debugging information?

I configured gcc as follows:
../configure
--prefix=/c/mbuild/release --enable-shared=libstdc++ --enable-threads --enable-version-specific-runtime-libs --enable-languages=c,c++ --with-dwarf2 --disable-sjlj-exceptions --disable-win32-registry --disable-werror --disable-nls --disable-multilib --with-gmp=/c/mbuild/release --with-ppl=/c/mbuild/release --disable-ppl-version-check --with-cloog=/c/mbuild/release --disable-cloog-version-check --with-mpfr=/c/mbuild/release --with-mpc=/c/mbuild/release --enable-libgomp --with-libiconv-prefix=/c/mbuild/release
--enable-libstdcxx-debug --enable-cxx-flags='-s -O2' *--with-boot-ldflags='-s'* --with-boot-cflags='-s -O2' --with-boot-cxxflags='-s -O2' &>config.my.log
and build:
make -j4 BOOT_CFLAGS='-s -O2'
BOOT_CPPFLAGS='-s -O2' &>make.my.log
I've got everything optimized, except libstdc++-6.dll. It size is 5Mb!
So... What options should i use during gcc (mingw) configuration to build libstdc++.dll without debugging information?
NOTE:
I need debug and release versions of libstdc++, so I'm using
--enable-libstdcxx-debug - Build separate debug libraries in addition to what is normally built.
This flag makes another libstdc++-6.dll (somwhere in lib dir), wich is larger, than dll in the bin dir.
You should pass strip option to linker, not to compiler (-s). And to compiler you should pass "-g -O0" for debug build, which means include debug information + stright code generation without any optimization (the last one is for case you read disasm code, it makes stuff clearer). So, try adding to LDFLAGS environment variable -s option for build time.
As an alternative, you could use "strip" program (part of MSYS) to strip all debug info from executable and/or library binary file.

Resources