conflicting types for '__readlink' during make glibc 2.14 - glibc

I made a softwareupdate on a simulationsoftware which needs a newer version of glibc. Therefore I wanted to install the glibc version 2.14 on a new prefix.
According to How to upgrade glibc from version 2.12 to 2.14 on CentOS?
i tried to install it on a sles11sp3
mkdir /var/mpi/Libraries/glibc_install; cd /var/mpi/Libraries/glibc_install
wget http://ftp.gnu.org/gnu/glibc/glibc-2.14.tar.gz
tar zxvf glibc-2.14.tar.gz
cd glibc-2.14
mkdir build
cd build
../configure --prefix=/var/mpi/Libraries/glibc-2.14
make -j4
During the make I get the following error:
readlink.c:26: error: conflicting types for ‘__readlink’
../include/unistd.h:120: error: previous declaration of ‘__readlink’ was here
make[2]: *** [/var/mpi/Libraries/glibc_install/glibc-2.14/build/io/readlink.o] Error 1
make[2]: *** Waiting for unfinished jobs....
make[2]: Leaving directory `/var/mpi/Libraries/glibc_install/glibc-2.14/io'
make[1]: *** [io/subdir_lib] Error 2
make[1]: Leaving directory `/var/mpi/Libraries/glibc_install/glibc-2.14'
make: *** [all] Error 2
Do you have a clue how to solve this problem?

io/readlink.c is just a stub implementation which always fails at run time. It is not supposed to be compiled at all when building for GNU/Linux. Instead, the implementation should come from the generic system call wrapper in sysdeps/unix/syscalls.list:
readlink - readlink i:spi __readlink readlink
However, recent Linux architectures (those called generic in Linux parlance, currently aarch64, csky, nios2, and riscv) no longer have a readlink system call, and the function as to be implemented using readlinkat. This implementation is in the file sysdeps/unix/sysv/linux/generic/readlink.c.
It's not clear what you are doing so that the wrong file is compiled. Are you sure you have installed compatible kernel headers?
The particular upstream commit (which went into glibc 2.15):
commit 95b7042bac3e2cfc6fef7aec6acc7d46dd50eba5
Author: Roland McGrath <roland#hack.frob.com>
Date: Fri Nov 11 10:02:42 2011 -0800
Fix __readlink declaration.
But given the fundamental nature of the build problem you encountered, I doubt that applying this patch, while addressing the immediate build failure, will give you a functional glibc build in the end.

GLIBC : 2.14 → 2011-06-01. The "bugfix version" 2.14.1 → 2011-10-07 https://ftp.gnu.org/gnu/glibc/
Note : make -j4 is not recommended for glibc, as far as I remember.
My tests (old SLE11 SP2) : The SLE 11 SP2 gcc 4.3.2 is too old for glibc-2.14.1, may be the SP3 minor gcc update (to 4.3.4) is also too old?
Using the "extra EL 6 gcc-4.9.3" .... for glibc-2.14.1 :
cd build-glibc214/ # the recommended build directory outside the glibc source
export CC=gcc49 CXX=g++49 && ../glibc-2.14.1/configure --prefix=/opt/glibc214
make # no errors
# make install # OK
Extra gcc´s : how to install gcc 4.9.2 on RHEL 7.4

Related

Building gcc-4.1.2 on Fedora 17 (32-bit) VM

I'm working with some legacy hardware, and I need to compile a customised version of opensslv0.9.8e onto a 32-bit system.
My Fedora 17 VM comes with gcc-4.7.2. Unfortunately, compiling the openssl version with this doesn't work, I get illegal instruction errors. I found posts here and here that suggest that this version of openssl doesn't compile with gcc 4.2.0 or higher
when compiling openssl 0.9.8e with gcc 4.2.0, some errors show up (see
below). The test suite then fails with "instruction error". (The resulting
programs also fail.)
I built and checked gcc-4.1.2 on the system where the reported error arose.
I then rebuilt openssl with gcc-4.1.2 and could successfully run the test
suite.
My current plan is to build 4.1.2 onto my system. Unfortunately, when doing so, I run into the following error:
WARNING: 'makeinfo' is missing on your system. You should only need it if you modified a '.texi'
or a '.texinfo' file, or any other file indirectly affecting the aspect of the manual. The
spurious call might also be the consequence of using a buggy 'make' (AIX, DU, IRIX). You might
want to install the 'Texinfo' package or the 'GNU make' package. Grab either from any GNU archive site
Then,
make[3]: ***[fastjar.info] Error 1
make[3]: Leaving directory '/home/charles/build/make/fastjar'
. . .
make: *** [all] Error 2
I've installed texinfo, but I can't find gmake on the yum package manager.
What are the next steps I should take? I'm stumped at the moment ):

error "missing separator" in build qwt-6.1

My environment:
QT: Qt_5_0_2
QWT: qwt-6.1-rc3
MinGW: mingw47_32
OS: win7_32
I follow the introduction file "INSTALL"'s step:
C) Win32/MinGW
Check that your Qt version has been built with MinGW - not with MSVC !
Start a Shell, where Qt4 is initialized. ( F.e. with
"Programs->Qt by Trolltech ...->Qt 4.x.x Command Prompt" ).
Check if you can execute "make" or something like "mingw32-make".
qmake qwt.pro
make
make install
I get the error in the step "make":
C:\qwt-6.1-rc3>qmake qwt.pro
C:\qwt-6.1-rc3>mingw32-make
cd src\ && ( if not exist Makefile E:\Qt\5.0.2\5.0.2\mingw47_32\bin\qmake.exe C:
\qwt-6.1-rc3\src\src.pro -o Makefile ) && mingw32-make -f Makefile
mingw32-make[1]: Entering directory 'C:/qwt-6.1-rc3/src'
mingw32-make -f Makefile.Release all
mingw32-make[2]: Entering directory 'C:/qwt-6.1-rc3/src'
Makefile.Release:305: *** missing separator. Stop.
mingw32-make[2]: Leaving directory 'C:/qwt-6.1-rc3/src'
Makefile:40: recipe for target 'release-all' failed
mingw32-make[1]: *** [release-all] Error 2
mingw32-make[1]: Leaving directory 'C:/qwt-6.1-rc3/src'
makefile:44: recipe for target 'sub-src-make_first-ordered' failed
mingw32-make: *** [sub-src-make_first-ordered] Error 2
The lines 304,305 in "Makefile.Release" are:
304 qmake: FORCE
305 #$(QMAKE) -o Makefile.Release src.pro
Where is wrong?
thanks
Makefile.Release:305: *** missing separator. Stop.
This usually means this Makefile is not of the right format for mingw32-make;
Since the Makefile is generated by qmake, you should check the QMAKESPEC of your qmake. It should be win32-g++, not win32-mvsc.
This issue is strongly linked to the first warning of the qwt INSTALL note :
Check that your Qt version has been built with MinGW - not with MSVC !
Guess your broken Makefile is leftover from some earlier attempts - remove the Qwt build directory completely and start from scratch.
For loading the Qwt designer plugin in the Qt creator you need to have a version that is compatible with how the creator had been built. AFAIR the 5.0.2 mingw package contains a version 2.7.0 of the creator, that had been built for Qt 4.8 with MSVC ( see About->Qt creator ). If true it means you need to have 2 different builds of Qwt - one for your application, the other one for the designer plugin.
For the future I'm planning to offer precompiled versions of the designer plugin that are compatible with current binary packages of the Qt creator.
Also note that in SVN trunk the default settings for building the plugin have been changed since rc3: on windows the library is statically linked into the plugin and on better systems you have a similar effect with compiling in the install path of the library ( see RPATH ).
I had the same problem. The reason was that I wanted to prepare sources second time. I had sources in svn floder. I solved proble erasing folder and update sources again. After this operation I was able to run 'qmake proj.pro' correctly.

Trouble Making Spooles

I am trying to make Spooles 2.2-9 on Mint Maya linux distro and I get the following error.
aaron#atown ~/Downloads/spooles $ sudo make global
cd A2/src ; make -f makeGlobalLib
make[1]: Entering directory `/home/aaron/Downloads/spooles/A2/src'
makeGlobalLib:19: warning: overriding commands for target `.c.o'
../../Make.inc:90: warning: ignoring old commands for target `.c.o'
/usr/lang-4.0/bin/cc -c -O basics.c -o A2_basics.o
make[1]: /usr/lang-4.0/bin/cc: Command not found
make[1]: *** [basics.o] Error 127
make[1]: Leaving directory `/home/aaron/Downloads/spooles/A2/src'
make: *** [global] Error 2
I am new to linux so any help would be most useful.Thanks
Have you tried installing it from your software package manager? I know that package is provided by Ubuntu and Debian, and Mint is a derivative so it should have it available for installation. No need to build it yourself.
If you do want to compile it yourself, first note you should never build software as root (don't prefix the make command with sudo). It's possible that if there's an install step you'll need to run that as root, but generally not the build.
Second it looks like by default this package is configured to build on OSX (I think /usr/lang-4.0/bin/cc is an OSX path... maybe?). In any event, that's not where the compiler lives on Linux: try this to override the compiler:
make CC=gcc global
It's also possible that your system does not have a compiler installed. If you get an error from the above then use your software package manager to install the gcc package.

Building GCC cross compiler (from "Linux" to "Windows")

I want to build "gcc cross-compiler" to compile "c/c++" applications on "Linux" environment but for "Windows" target.
I have made this so far:
Installed the necessary tools and packages for building GCC listed on "Prerequisites for GCC" page.
Downloaded required sources:
"gcc-core-4.4.1", "gcc-g++-4.4.1", "binutils-2.19.1", "w32api-3.13-mingw32", "mingwrt-3.16-mingw32"
Created this directory hierarchy:
"${HOME}/gcc/" - for final cross-compiler
"${HOME}/src/" - for sources
"${HOME}/src/build-binutils/i386-mingw32/" - for building binutils to "i386-mingw32" target
"${HOME}/src/build-gcc/i386-mingw32/" - for building gcc to "i386-mingw32" target
Builded binutils package:
cd "${HOME}/src/build-binutils/i386-mingw32/"
../../binutils-2.19.1/configure --prefix="${HOME}/gcc" --target=i386-mingw32 --disable-nls
make
make install
Copied "w32api" and "mingwrt" headers to the install directory:
cp -R "${HOME}/src/w32api-3.13-mingw32/include" "${HOME}/gcc/i386-mingw32"
cp -R "${HOME}/src/mingwrt-3.16-mingw32/include" "${HOME}/gcc/i386-mingw32"
And now when I am trying to build the "c (only) cross-compiler":
cd "${HOME}/src/build-gcc/i386-mingw32/"
../../gcc-4.4.1/configure --prefix="${HOME}/gcc" --target=i386-mingw32 --enable-languages=c --with-headers="${HOME}/gcc/i386-mingw32/include" --disable-nls
make<br>
it was building something about 4 minutes and then gives me these errors:
${HOME}/gcc/i386-mingw32/bin/ld: dllcrt2.o: No such file: No such file or directory
collect2: ld returned 1 exit status
make[2]: *** [libgcc_s.dll] Error 1
make[2]: Leaving directory `${HOME}/src/build-gcc/i386-mingw32/i386-mingw32/libgcc'
make[1]: *** [all-target-libgcc] Error 2
make[1]: Leaving directory `${HOME}/src/build-gcc/i386-mingw32'
make: *** [all] Error 2
From that error message I really don't know what to do now :-((( .
Does anybody know where is the problem?
Thanks.
That's actually OK: the way things go, you need to
build binutils
install headers
build the a partial C compiler: enough to create object files, but not enough to link
build the win32api and mingw runtime (which includes your missing dllcrt2.o)
build a complete C compiler (and other front-ends, such as C++, Fortran, Ada, whatever, if you want them)
You have successful performed step 3 above; it fails building libgcc (which is a GCC support library), but that means the C compiler core is functionnal (although it won't be able to link, it can still create valid object files). You can check that by looking at the gcc/xgcc file in your GCC build directory.
So, you need to go to the next step, not worrying about your current failure.
(To actuall install the partial C compiler, you should run make with the -k option, to have it do it best, even in the face of errors. For example, use make -k install.)
There are precompiled cross-compilers of MinGW-w64 available.
This allows to compile native 32- and 64-bit Windows binaries from Linux, a two minute tutorial is available at http://www.blogcompiler.com/2010/07/11/compile-for-windows-on-linux/
Just in case you don't want to spend a lot of time trying to build it yourself.
I grepped through the MinGW sources, and found that dllcrt2.o is something built off the mingwrt package. I assume you have to compile and install that, not just copy the headers?

Error 1 & 2 when compiling GCC 4.4.2 on OpenSolaris 2009.06

My problem:
I've been trying to compile, build, and install GCC 4.4.2 in my installation of OpenSolaris 2009.06 on my VirtualBox 3 i386 machine. But I keep getting this same error when running make:
> checking whether ln -s works... yes
checking for i386-pc-solaris2.11-gcc... /src/gcc-4.4.2/host-i386-pc-solaris2.11/gcc/xgcc -B/src/gcc-4.4.2/host-i386-pc-solaris2.11/gcc/ -B/usr/gnu/i386-pc-solaris2.11/bin/ -B/usr/gnu/i386-pc-solaris2.11/lib/ -isystem /usr/gnu/i386-pc-solaris2.11/include -isystem /usr/gnu/i386-pc-solaris2.11/sys-include
checking for suffix of object files... configure: error: in `/src/gcc-4.4.2/i386-pc-solaris2.11/libgcc':
configure: error: cannot compute suffix of object files: cannot compile
See `config.log' for more details.
make[2]: *** [configure-stage1-target-libgcc] Error 1
make[2]: Leaving directory `/src/gcc-4.4.2'
make[1]: *** [stage1-bubble] Error 2
make[1]: Leaving directory `/src/gcc-4.4.2'
make: *** [all] Error 2
Attempted solutions:
I tried the answer to this question:
Problem compiling gcc 4.4.0 on OpenSolaris 2009.6 i.e.
./configure --prefix=/usr/gnu --with-gmp=/usr/gnu --with-mpfr=/usr/gnu --with-as=/usr/sfw/bin/gas --with-gnu-as --with-gnu-ld
I tried GNU GCC's platform specific solution:
GNU Solaris specific build instructions
i.e.
./configure --prefix=/usr/gnu --with-gmp=/usr/gnu --with-mpfr=/usr/gnu --with-as=/usr/sfw/bin/gas --with-gnu-as --with-ld=/usr/ccs/bin/ld --without-gnu-ld --enable-shared
I am still getting the same errors despite running ./configure with the two solutions above
Any help would be appreciated!
Thanks!
Can you compile programs with the existing GCC?
If not, you need to resolve that.
If you can, then you need to look at that monstrous 7-argument command (the one where it says 'checking for i386-pc-solaris2.11-gcc' - why those 7 arguments?).
Are you running 'make bootstrap'?
If not, what happens when you do?
If so, whereabouts in the processing is it? (Is this stage 1, or stage 2, or what?)
Are you using the recommended setup, with the source for GCC in, say, /src/gcc-4.4.2 and the object files in, say, /src/gcc-4.4.2-obj?
If not, do so. Use: cd /src/gcc-4.4.2-obj; ../gcc-4.4.2/configure ...
Which shell do you use?
On regular Solaris 10 (not OpenSolaris - and SPARC, not Intel), I have to set CONFIG_SHELL=/bin/ksh in the environment to make things compile (by default, it uses /bin/sh, but the /bin/sh on Solaris 10 is Bourne shell and there's a script deep down in the Java section (IIRC) that uses Bash/Korn/POSIX shell notations like $(cmd ...)). However, that normally affects a much later stage in the processing.
However, I have got GCC 4.4.2 on Solaris 10 without problem (using GCC 4.4.1 as the bootstrap compiler).

Resources