installing gcc version 4.8.2 in redhat have an error - c++

First run ./configure it worked,
then make -j4, it will report
options.c:11145: error: narrowing conversion of '-0x00000000000000001' from 'int' to 'short unsigned int' inside { }
GMP、MPFR、MPC install successed
cat /proc/version
Linux version 2.6.32-504.23.4.el6.x86_64 (mockbuild#x86-029.build.eng.bos.redhat.com) (gcc version 4.4.7 20120313 (Red Hat 4.4-9) (GCC) ) #1 SMP Fri May 29 10:16:43 EDT 2015
file /bin/ls
/bin/ls: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.18, stripped
lsb_release -a
LSB Version: :base-4.0-amd64:base-4.0-noarch:core-4.0-amd64:core-4.0-noarch:graphics-4.0-amd64:graphics-4.0-noarch:printing-4.0-amd64:printing-4.0-noarch
Distributor ID: RedHatEnterpriseServer
Description: Red Hat Enterprise Linux Server release 6.6 (Santiago)
Release: 6.6
Codename: Santiago

Related

lubuntu does not see executable file generated by ocamlopt on NixOS

i created executable "standalone" file in NixOS (x86_64) using "ocamlopt" native compiler with option -linkall. and the generated program is executed in NixOS. so far so good
after that i tried to execute this file under Lubuntu
lubuntu#lubuntu:~/Documents$ uname -a
Linux lubuntu 4.18.0-10-generic #11-Ubuntu SMP Thu Oct 11 15:13:55 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux
but recieved:
lubuntu#lubuntu:~/Documents$ ./a.out
bash: ./a.out: No such file or directory
i am quite sure that architecture is suitable:
lubuntu#lubuntu:~/Documents$ objdump -h a.out
a.out: file format elf64-x86-64
what i did wrong? on NixOS, on OCaml, on Lubuntu?
Tnx in advance
UDP: my NixOS distro:
$> uname -a
Linux cat 4.19.36 #1-NixOS SMP Sat Apr 20 07:16:05 UTC 2019 x86_64 GNU/Linux
ocaml:
$> ocamlopt -v
The OCaml native-code compiler, version 4.06.1
UDP2:
$> readelf -a a.out | grep ld-
[Requesting program interpreter: /nix/store/681354n3k44r8z90m35hm8945vsp95h1-glibc-2.27/lib/ld-linux-x86-64.so.2]
"No such file or directory" (ENOENT) when trying to execute a file that does exist usually means that its dynamic linker path (ELF interpreter) doesn't exist. It's exactly the same error for the same reason you'd get from executing a text file that started with #!/non-existant/path
Use strace ./a.out to see that the only system call is the execve which fails.
Most GNU/Linux distros use /lib64/ld-linux-x86-64.so.2. For example file /bin/ls on my Arch GNU/Linux desktop shows:
/bin/ls: ELF 64-bit LSB pie executable, x86-64, version 1 (SYSV),
dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2,
BuildID[sha1]=4fef2dc9762eb7d4593f402a65cc02bb3d4c48de, for GNU/Linux
3.2.0, stripped
Presumably NixOS, or at least ocamlopt on NixOS, uses a different path. Use file to check. (Or readelf -a to show the ELF program headers will also dump the interpreter path.)
ldd can also show the interpreter path, but IIRC fails if the path isn't valid.

error: ‘POPT_ARG_ARGV’ undeclared. Do I need to use an older gcc?

I'm trying to build a C++ project from https://github.com/alanxz/rabbitmq-c
However, when I run the command
cmake --build . --target install
This error appeared,
error: ‘POPT_ARG_ARGV’ undeclared (first use in this function)
Not sure if it's relevent, but my GCC
gcc (GCC) 4.1.2 20080704 (Red Hat 4.1.2-55)
My CentOS
CentOS release 5.11 (Final)
CentOS 5.x has popt version 1.13, but the POPT_ARG_ARGV type was added in version 1.14.

Not able to use C++14 features( bind,lambdas,etc and getting C++11extension warning) after installing gcc49?

It shows that gcc49 is active:
$ port select --list gcc
Available versions for gcc:
mp-gcc49 (active)
none
but version is still 4.2.1,
$ gcc --version
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
Apple LLVM version 5.1 (clang-503.0.40) (based on LLVM 3.4svn)
Target: x86_64-apple-darwin13.4.0
Thread model: posix
How do i fix this?

fail to include sys/proc.h in Solaris 10

Here is the same code:
#include <sys/proc.h>
int main(){
return 0;
}
Here is the library:
ROHIT root#solaris-demo:/$ ls -ltr /usr/include/sys/proc.h
-rw-r--r-- 1 root bin 30063 Jan 11 2013 /usr/include/sys/proc.h
And here is the compilation result:
ROHIT root#solaris-demo:/var/tmp/$ gcc test.c
In file included from test.c:1:
/usr/include/sys/proc.h:367: error: syntax error before "klgrpset_t"
Can anyone help me to know the reason behind this error and possible fix?
Here is additional information regarding my compiler and OS version:
ROHIT root#solaris-demo:/var/tmp/$ which gcc
/usr/sfw/bin/gcc
ROHIT root#solaris-demo:/var/tmp/$
ROHIT root#solaris-demo:/var/tmp/$ gcc -v
Reading specs from /usr/sfw/lib/gcc/i386-pc-solaris2.10/3.4.3/specs
Configured with: /builds/sfw10-gate/usr/src/cmd/gcc/gcc-3.4.3/configure --prefix=/usr/sfw --with-as=/usr/sfw/bin/gas --with-gnu-as --with-ld=/usr/ccs/bin/ld --without-gnu-ld --enable-languages=c,c++ --enable-shared
Thread model: posix
gcc version 3.4.3 (csl-sol210-3_4-branch+sol_rpath)
ROHIT root#solaris-demo:/var/tmp/$
ROHIT root#solaris-demo:/var/tmp/$ uname -a
SunOS solaris-demo 5.10 Generic_147148-26 i86pc i386 i86pc
ROHIT root#solaris-demo:/var/tmp/$
ROHIT root#solaris-demo:/var/tmp/$ cat /etc/release
Oracle Solaris 10 8/11 s10x_u10wos_17b X86
Copyright (c) 1983, 2011, Oracle and/or its affiliates. All rights reserved.
Assembled 23 August 2011

GCC 4.9.2 cross-compiler build for ARM

I am trying to build a cross-compiler for ARM. When I add c++ to my "enable-languages" list in the configure (see) below, the gmake errors out with:
checking for exception model to use...
configure: error: unable to detect exception model
gmake[1]: *** [configure-target-libstdc++-v3]
but when I take c++ out of the "enable-languages", as in my configure script below, the GCC cross-compiler builds just fine.
../gcc-4.9.2/configure --prefix=/home/me/ANDROID21 --target=arm-linux-androideabi
--with-gmp=/home/me/ANDROID21 --with-mpfr=/home/me/ANDROID21
--with-mpc=/home/me/ANDROID21
--with-gnu-as--with-gnu-ld --enable-languages=c,fortran --disable-nls
--disable-tls
--disable-bootstrap --disable-libgomp --disable-shared --disable-libssp
-disable-libquadmath --enable-threads --enable-target-optspace --disable-libatomic
--with-sysroot=/home/me/android-ndk-r10c/platforms/android-21/arch-arm
For reference, here is my machine info:
$ uname -a
Linux (system name) 2.6.32-504.el6.x86_64 #1 SMP Tue Sep 16 01:56:35 EDT 2014 x86_64 x86_64 x86_64 GNU/Linux
And the GCC I'm building off of:
$ gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/home/me/GCC4.9.2/libexec/gcc/x86_64-unknown-linux-gnu/4.9.2/lto-wrapper
Target: x86_64-unknown-linux-gnu
Configured with: /home/me/gcc-4.9.2/configure --prefix=/home/me/GCC4.9.2 --disable-multilib
--enable-libgomp --enable-languages=c,c++,objc,obj-c++,java,fortran
Thread model: posix
gcc version 4.9.2 (GCC)
Any ideas on possible causes?
Haven't found anything definitive in the archives yet. Would really like to get the c++ portion to cross-compile too.
TIA,
Steve