Weird scons v8 compilation issue - compilation

I use fedora 15, here is what i get when i try to run scons :
scons: Reading SConscript files ...
scons: done reading SConscript files.
scons: Building targets ...
g++ -o obj/release/accessors.o -c -fno-rtti -fno-exceptions -fvisibility=hidden -Wall -Werror -W -Wno-unused-parameter -Wnon-virtual-dtor -pedantic -m32 -O3 -fomit-frame-pointer -fdata-sections -ffunction-sections -ansi -DV8_TARGET_ARCH_IA32 -DENABLE_DEBUGGER_SUPPORT -Isrc src/accessors.cc
scons: *** [obj/release/accessors.o] Error 127
scons: building terminated because of errors.
If i try to run the g++ command, it works w/out any warning and the .o file is generated.
What's weird is that it's working on another computer w/ fedora 15.
Any help? Thanks.
PS : scons -v :
SCons by Steven Knight et al.:
script: v2.1.0.r5357[MODIFIED], 2011/09/09 21:31:03, by bdeegan on ubuntu
engine: v2.1.0.r5357[MODIFIED], 2011/09/09 21:31:03, by bdeegan on ubuntu
engine path: ['/usr/lib/scons/SCons']
Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 The SCons Foundation

Check your $PATH variable in the SConscript.
Error 127 means that your builder (scons, here) has not been able to locate a required executable (g++).
If your PATH is OK, see if you can set manually the g++ full path.

Related

Why when gcc is built from source, libstdc++ is built for wrong architecture, 32bit, while 64 is expected?

I am trying to compile lftp from source using gcc, compiler that I have also compiled from source under my home folder.
On build step I get an error:
/bin/sh ../libtool --silent --tag=CXX --mode=link g++ -O2 -Wall -Wwrite-strings -Woverloaded-virtual -fno-exceptions -fno-rtti -fno-implement-inlines -export-dynamic -s -o lftp lftp-lftp.o lftp-complete.o lftp-lftp_rl.o lftp-attach.o liblftp-jobs.la liblftp-tasks.la -L/usr/lib -lreadline -lutil -lncurses -ldl
/gsa/pokgsa/home/l/e/leonidt/local/lib/../lib/libstdc++.so: error adding symbols: File in wrong format
collect2: error: ld returned 1 exit status
make[2]: * [lftp] Error 1
make[2]: Leaving directory /gsa/pokgsa-h3/19/leonidt/local/lftp-4.8.4/src'
make[1]: *** [install-recursive] Error 1
make[1]: Leaving directory/gsa/pokgsa-h3/19/leonidt/local/lftp-4.8.4'
make: * [install] Error 2
So looks like compiler was built with libstdc++.so for wrong architecture?
I tried to check what's in libstdc++.so:
file /gsa/pokgsa/home/l/e/leonidt/local/lib/libstdc++.so
/gsa/pokgsa/home/l/e/leonidt/local/lib/libstdc++.so: symbolic link to `libstdc++.so.6.0.27'
file /gsa/pokgsa/home/l/e/leonidt/local/lib/libstdc++.so.6.0.27
/gsa/pokgsa/home/l/e/leonidt/local/lib/libstdc++.so.6.0.27: **ELF 32-bit** MSB shared object, IBM S/390, version 1 (GNU/Linux), dynamically linked, not stripped
Below are the steps I did to build gcc in my local folder:
cd ~/local
Uncompressed the gcc-9.2.0.tar.xz
got ~/local/gcc-9.2.0 created with gcc source
cd ../gcc-9.2.0/
Downloaded prerequisites
contrib/download_prerequisites
cd ~/local/gcc-build
../gcc-9.2.0/configure --prefix /gsa/pokgsa/home/l/e/leonidt/local/ --enable-languages=c,c++
I am on SuSe Linux:
uname -a
Linux zdsdeveng03 3.0.101-108.84-default #1 SMP Fri Nov 30 15:57:27 UTC 2018 (7a72692) s390x s390x s390x GNU/Linux
cat /etc/os-release NAME="SLES"
VERSION="11.4"
VERSION_ID="11.4"
PRETTY_NAME="SUSE Linux Enterprise Server 11 SP4"
ID="sles"
ANSI_COLOR="0;32"
CPE_NAME="cpe:/o:suse:sles:11:4"
You have to specify architecture(s) for configure script.
https://gcc.gnu.org/install/configure.html

Build wxWidgets 2.8.12 GCC 4.6.2

I am getting this error when building wxWidgets in Cygwin:
../src/generic/dirctrlg.cpp:67:24: fatal error: direct.h: No such file or directory
compilation terminated.
make: *** [corelib_dirctrlg.o] Error 1
T_BITS=64 -D_LARGE_FILES -D__WXDEBUG__ -I/cygdrive/c/wxWidgets-2.8.12/build-debug/lib/wx/include/msw-ansi-debug-static-2.8 -I../include -Wall -Wundef -Wno-ctor-dtor-privacy -ggdb -O0 ../src/generic/dirctrlg.cpp
Makefile:28340: recipe for target `corelib_dirctrlg.o' failed
I followed the instructions included in wxWidgets for Windows using configure in install.txt(Compiling wxWidgets).
Which compiler do you use? See http://wxwidgets.blogspot.com/2011/06/choosing-gcc-for-building-wxwidgets.html for some of the choices you have. FWIW direct.h should be present in MinGW compiler headers.

Error on compilation of x264 on qnap

We are facing issues on compiling x264 on qnap.
We need to compile ffmpeg with x264 library, qnap packages have the built-in x264 0.66 library but ffmpeg-0.9.2 doesn't support too old version of x264 and produces the following error on compiling x264 from source.
[/share/MD0_DATA/.qpkg/x264-snapshot-20130208-2245] # make
gcc -Wshadow -O3 -ffast-math -m32 -Wall -I. -I. -march=i686 -mfpmath=sse -msse -std=gnu99 -I/opt/include -I/opt/include -fomit-frame-pointer -fno-tree-vectorize -c -o x264.o x264.c
x264.c: In function 'help':
x264.c:401: error: 'X264_VERSION' undeclared (first use in this function)
x264.c:401: error: (Each undeclared identifier is reported only once
x264.c:401: error: for each function it appears in.)
make: *** [x264.o] Error 1
[/share/MD0_DATA/.qpkg/x264-snapshot-20130208-2245] # cat /proc/version
Linux version 2.6.33.2 (root#NasX86-4) (gcc version 4.1.3 20070929 (prerelease) (Ubuntu 4.1.2-16ubuntu2)) #1 SMP Wed Dec 5 06:48:23 CST 2012
Can someone assist me on that ?
Probably version.sh does not have execution permission. So, chmod 744 version.sh then retry configure and make.
X264_VERSION define is generated in x264_config.h during configure script execution by calling to version.sh. So either it wasn't generated in x264_config.h (some fault of your building environment and need analyze of config.log) or you have old x264.h headers somewhere in you include path which for some reason used instead of new one.
Removing --prefix="path" from the ./configure arguments fixed this error for me.

gcc cannot find bits/predefs.h on i686

Okay, so, I switched from ubuntu 12.04 64-bit to 32-bit and installed build-essential.
I then compiled and installed GMP-5.0.5, MPFR-3.1.1, MPC-1.0, ISL-0.10 and CLOOG-0.17.0. I checked out a copy of the main gcc trunk and attempted to build it with the following configure line (from a separate directory):
../svnsrc/configure --prefix=/usr/GCC/svn --enable-__cxa_atexit --with-plugin-ld=/usr/bin/ld.gold --enable-threads=posix --enable-werror --enable-build-with-cxx --with-gmp=/usr/GCC/prereq/svn --with-mpfr=/usr/GCC/prereq/svn --with-mpc=/usr/GCC/prereq/svn --with-isl=/usr/GCC/prereq/svn --with-cloog=/usr/GCC/prereq/svn --enable-languages=c,c++
Configure ran fine and so I ran make && make check. This ran fine for a while, but then it failed with the following error:
/home/matt/GCC/svnbuild/./gcc/xgcc -B/home/matt/GCC/svnbuild/./gcc/ -B/usr/GCC/svn/i686-pc-linux-gnu/bin/ -B/usr/GCC/svn/i686-pc-linux-gnu/lib/ -isystem /usr/GCC/svn/i686-pc-linux-gnu/include -isystem /usr/GCC/svn/i686-pc-linux-gnu/sys-include -g -O2 -O2 -g -O2 -DIN_GCC -W -Wall -Wwrite-strings -Wcast-qual -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition -isystem ./include -fpic -mlong-double-80 -g -DIN_LIBGCC2 -fbuilding-libgcc -fno-stack-protector -fpic -mlong-double-80 -I. -I. -I../.././gcc -I../../../svnsrc/libgcc -I../../../svnsrc/libgcc/. -I../../../svnsrc/libgcc/../gcc -I../../../svnsrc/libgcc/../include -I../../../svnsrc/libgcc/config/libbid -DENABLE_DECIMAL_BID_FORMAT -DHAVE_CC_TLS -DUSE_TLS -o _muldi3.o -MT _muldi3.o -MD -MP -MF _muldi3.dep -DL_muldi3 -c ../../../svnsrc/libgcc/libgcc2.c -fvisibility=hidden -DHIDE_EXPORTS
In file included from /usr/include/stdio.h:28:0,
from ../../../svnsrc/libgcc/../gcc/tsystem.h:88,
from ../../../svnsrc/libgcc/libgcc2.c:29:
/usr/include/features.h:324:26: fatal error: bits/predefs.h: No such file or directory
#include <bits/predefs.h>
^
compilation terminated.
make[3]: *** [_muldi3.o] Error 1
make[3]: Leaving directory `/home/matt/GCC/svnbuild/i686-pc-linux-gnu/libgcc
I looked around, but everything I seemed to find was that this error was caused on x86_64, by not installing gcc-multilib, because Ubuntu and Debian use the mutiarch system, separating the libraries. Okay, fine...but I'm using i686, so why would I need the 64-bit libraries? Any help would be appreciated. Thanks.
Try doing a
sudo apt-get install gcc-multilib
I don't think that installing a 32-bit system changes the architecture of your computer, because your computer will always be a 64-bit machine. Installing the 64-bit version of Ubuntu should only give better multi-core performance. Since your computer is still a 64-bit computer, you probably need a C compiler that will compile on 64-bit machines. Hence the gcc-multilib. I think.
the gcc-multilib trick didn't work out for me. Instead, setting this in the build environment did the trick:
C_INCLUDE_PATH=/usr/include/$(gcc -print-multiarch)

Error trying to exec cc1, gcc only wants to compile for avr?

I've installed gcc on my Mac (Snow Leopard) so I can compile for AVR microcontrollers. However, it seems to be preventing me from compiling for anything else. I'd like to build the packages from astrometry.net, and when I run ./configure then make i get the following:
make -C ./qfits-an stage CFLAGS=" -g -Wall -ffinite-math-only -fno-signaling-nans -march=native -O3 -fomit-frame-pointer -DNDEBUG -fPIC -Winline -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE" LDFLAGS=" -g -Wall -ffinite-math-only -fno-signaling-nans -march=native -O3 -fomit-frame-pointer -DNDEBUG -fPIC -Winline" CC="gcc"
make -C src stage
gcc -g -Wall -ffinite-math-only -fno-signaling-nans -march=native -O3 -fomit-frame-pointer -DNDEBUG -fPIC -Winline -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -c -o anqfits.o anqfits.c
gcc: error trying to exec 'cc1': execvp: No such file or directory
gcc -v gives:
Using built-in specs.
Target: avr
Configured with: ./configure --target=avr --enable-languages=c,c++ --disable-nls --disable-libssp --prefix=/usr/local/staging.avr-gcc
Thread model: single
gcc version 4.1.1
I'm not sure how to proceed! It seems that currently everything is set up to only build for the AVR platform, but I have Xcode installed so somewhere there are more versions of gcc lurking. This install was via http://www.micahcarrick.com/installing-gnu-tools-avr-gcc.html if that helps to see how it was set up (I had Xcode installed prior to this).
The solution, I expect, is simple. I just want to avoid messing up my settings and then not being able to compile for either platform.
Many thanks!
You probably want to remove the non-cross-compiler named versions of the AVR tools you have installed (i.e. gcc, ld, etc.), so the cross-compiler, and related tools, are only available using target-specific names.
To do this, find the directory where they are installed (/usr/local/bin ?) and find all the tools installed at the same time. As an example, this is what happens on my Linux machine (to give you an idea):
$ which gcc
/usr/bin/gcc
$ cd /usr/bin
$ ls -li *gcc*
189389 -rwxr-xr-x 2 root root 268088 Dec 6 2011 gcc
195145 -rwxr-xr-x 1 root root 2018 Aug 16 2010 gccmakedep
189389 -rwxr-xr-x 2 root root 268088 Dec 6 2011 x86_64-redhat-linux-gcc
I would then remove gcc, leaving x86_64-redhat-linux-gcc as the only way of starting that compiler (they are hard linked as they share the same inode). There will be other tools as well, which you can identify by date in the same directory.
An alternative approach is to install the cross-compiler into a directory that isn't in your $PATH.

Resources