Trouble while building GCC compiler - gcc

So, I am trying to build the GCC compiler (8.1.0) from source, and I ran into a problem. I am trying to build it on Windows 7 and first, I tried building the 8.2.0 version and encountered the exact problem with the current version I am trying to build (figured since the 8.2.0 version came out on 26th of July, two weeks before posting this question, it had an issue :) ).
The first thing I am doing is configuring for the build process, with the following:
configure --program-suffix=-8.1.0. --enable-languages=c --disable-bootstrap --disable-shared --prefix="C:\Users\Vuk\Desktop\Diplomski\gcc-8.1.0\objdir"
I have previously made an objdir directory as it is recommended by the official guide. In which I plan to store the built compiler.
After the previous step i run:
make -j4
which leads to a few minutes of compiling and the 1st error message:
../../intl/localealias.c: In function ‘_nl_expand_alias’:
../../intl/localealias.c:164:25: error: incomplete universal character name \U
locale_alias_path = LOCALE_ALIAS_PATH;
^~~~~~~~~~~~~~~~~
../../intl/localealias.c:164:25: warning: unknown escape sequence: '\V'
../../intl/localealias.c:164:25: warning: unknown escape sequence: '\D'
../../intl/localealias.c:164:25: warning: unknown escape sequence: '\D'
../../intl/localealias.c:164:25: warning: unknown escape sequence: '\g'
../../intl/localealias.c:164:25: warning: unknown escape sequence: '\o'
make[2]: *** [Makefile:133: localealias.o] Error 1
Eventually, the second error message appears along with a gigantic wall of text which I can't display:
make[2]: Leaving directory '/cygdrive/c/Users/Vuk/Desktop/Diplomski/gcc-8.1.0/objdir/libiberty'
config.status: creating Makefile
config.status: creating backtrace-supported.h
config.status: creating config.h
config.status: executing libtool commands
config.status: executing gstdint.h commands
config.status: executing default commands
make[1]: Leaving directory '/cygdrive/c/Users/Vuk/Desktop/Diplomski/gcc-8.1.0/objdir'
make: *** [Makefile:889: all] Error 2
I am not doing all of this from the windows command line, instead, I am using cygwin64.

Replacing the original path
"C:\Users\Vuk\Desktop\Diplomski\gcc-8.1.0\objdir"
with
"C:/Users/Vuk/Desktop/Diplomski/gcc-8.1.0/objdir"
solves the problem.

Related

Compile Ruby from source on AIX 7.1

I am trying to compile Ruby 2.4.5 from source using gcc compiler on AIX 7.1. The configure works fine, but the make fails giving an error C is not a recognized flag. Anybody faced the same issue and managed to compile ruby on AIX 7.1?
Steps followed:
1) ./configure --disable-install-doc CC="gcc" CFLAGS="-maix64 -mminimal-toc" CXX="g++" CXXFLAGS="-maix64 -mminimal-toc" NM="nm -X64" AR="ar -X64" LDFLAGS="-maix64" EXTLDFLAGS=" -- works perfectly fine
2) make - fails with the below error
make: Not a recognized flag: C
usage: make [-einqrst] [-k|-S] [-d[A|adg[1|2]mstv]] [-D variable] [-f makefile] [-j [jobs]] [variable=value ...] [target ...]
make: 1254-004 The error code from the last command is 2.
Stop.
make: 1254-004 The error code from the last command is 2.
Stop.
make: 1254-004 The error code from the last command is 2.
Update :
Switching to GNU make gives the below error:
Making all in man
make[5]: Entering directory '/test/ruby-2.4.5/tst/ext/fiddle/libffi-3.2.1/man'
make[5]: Nothing to be done for 'all'.
make[5]: Leaving directory '/test/ruby-2.4.5/tst/ext/fiddle/libffi-3.2.1/man'
make[5]: Entering directory '/test/ruby-2.4.5/tst/ext/fiddle/libffi-3.2.1'
CC src/prep_cif.lo
CC src/types.lo
CC src/raw_api.lo
CC src/java_raw_api.lo
CC src/closures.lo
CC src/powerpc/ffi_darwin.lo
../../../../ext/fiddle/libffi-3.2.1/src/powerpc/ffi_darwin.c: In function 'ffi_p rep_args':
../../../../ext/fiddle/libffi-3.2.1/src/powerpc/ffi_darwin.c:112:17: warning: un used variable 'abi' [-Wunused-variable]
const ffi_abi abi = ecif->cif->abi;
^
CPPAS src/powerpc/aix.lo
libtool: compile: unable to infer tagged configuration
libtool: compile: specify a tag with `--tag'
Makefile:1335: recipe for target 'src/powerpc/aix.lo' failed
make[5]: *** [src/powerpc/aix.lo] Error 1
make[5]: Leaving directory '/test/ruby-2.4.5/tst/ext/fiddle/libffi-3.2.1'
Makefile:1596: recipe for target 'all-recursive' failed
make[4]: *** [all-recursive] Error 1
make[4]: Leaving directory '/test/ruby-2.4.5/tst/ext/fiddle/libffi-3.2.1'
Makefile:730: recipe for target 'all' failed
make[3]: *** [all] Error 2
make[3]: Leaving directory '/test/ruby-2.4.5/tst/ext/fiddle/libffi-3.2.1'
Makefile:370: recipe for target 'libffi-3.2.1/.libs/libffi_convenience.a' failed
make[2]: *** [libffi-3.2.1/.libs/libffi_convenience.a] Error 2
make[2]: Leaving directory '/test/ruby-2.4.5/tst/ext/fiddle'
exts.mk:212: recipe for target 'ext/fiddle/all' failed
make[1]: *** [ext/fiddle/all] Error 2
make[1]: Leaving directory '/test/ruby-2.4.5/tst'
uncommon.mk:220: recipe for target 'build-ext' failed
make: *** [build-ext] Error 2
The issue is that you are using AIX's built-in copy of make and it does not support the command-line option -C. That option is available in GNU make.
If you run make -v and do not see output like the following then you are not using GNU make:
GNU Make 3.81
Copyright (C) 2006 Free Software Foundation, Inc.
Run the command which make and it will return either /usr/bin/make or /opt/freeware/bin/make (or a similar path outside of /usr/bin):
If it returns /usr/bin/make then you do not have GNU make installed on your system and will need to follow one of several tutorials to get it installed on AIX.
If it returns /opt/freeware/bin/make then you do have GNU make installed, but it's not reflected in $PATH. You can add it to your path temporarily while you compile Ruby by running export PATH=/opt/freeware/bin:$PATH before you run the make command.
Update:
I would encourage you to open a separate question for your current build trouble, since the original question was about the -C flag for make not working on AIX, and now you have a separate question about running GNU make with an entirely different set of issues and possible solutions.
That said, it's possible you may be able to resolve your issue by starting over and running ./configure LIBTOOL='/usr/bin/libtool --tag=CC' (or whatever your path is to libtool). This is based off the following messages:
libtool: compile: unable to infer tagged configuration
libtool: compile: specify a tag with `--tag'
If this doesn't work then you'll probably have to edit the Makefile by looking for those specific invocations of libtool and append --tag=CC to them one by one until you're able to progress beyond these errors.
Both solutions are assuming that the only code being compiled is C. To my knowledge, everything in MRI that needs to be compiled is written in C, but if anything is written in C++ then the libtool invocations would require --tag=CXX. You can read more about tags here.

install mpfr: get into multiple errors

I want to install mpfr package as a non root user. I built it using this:
./configure --with-gmp-lib=/data/home/parisa/gmp-6.1.2/lib
, but after make I got the following error
WARNING: 'makeinfo' is missing on your system.
You should only need it if you modified a '.texi' file, or
any other file indirectly affecting the aspect of the manual.
You might want to install the Texinfo package:
<http://www.gnu.org/software/texinfo/>
The spurious makeinfo call might also be the consequence of
using a buggy 'make' (AIX, DU, IRIX), in which case you might
want to install GNU make:
<http://www.gnu.org/software/make/>
make[1]: *** [mpfr.info] Error 127
make[1]: Leaving directory `/data/home/parisa/mpfr-3.1.5/doc'
make: *** [all-recursive] Error 1
I searched this error in Internet, but I couldn't find something useful and easy to understand. So, I tried to install texinfo, but after configuring this warning message appears:
WARNING: 'aclocal-1.15' is missing on your system.
You should only need it if you modified 'acinclude.m4' or
'configure.ac' or m4 files included by 'configure.ac'.
The 'aclocal' program is part of the GNU Automake package:
<http://www.gnu.org/software/automake>
It also requires GNU Autoconf, GNU m4 and Perl in order to run:
<http://www.gnu.org/software/autoconf>
<http://www.gnu.org/software/m4/>
<http://www.perl.org/>
make: *** [aclocal.m4] Error 127
I also tried autoreconf -f -i before configuring, but with no success. I tried to use automake installed on our cluster by using LD_LIBRARY_PATH but again nothing changed.

Using mingw-w64 and ./configure --host=i686-w64-mingw32.static, make fails and Makefile CC variable looks wrong

I am new to compiling.
I am trying to compile iperf3 for Windows 10 because there is no official Windows distribution of iperf3 and for the learning experience. I am trying to do so on the new Windows Subsystem for Linux feature via Bash on Ubuntu on Windows, also for the learning experience.
I installed mingw-w64, which should give me the proper compiler and environment necessary for cross-compiling:
sudo apt-get install mingw-w64
This put two directories into my /usr directory:
i686-w64-mingw32
x86_64-w64-mingw32
It also put a bunch of things that look like compilers into /usr/bin.
I unzipped the .tar.gz file from iperf3 and navigated into it. Then, I run ./configure --host=i686-w64-mingw32.static and it completes without errors.
I note that the output of the command has a worrisome line: checking for i686-w64-mingw32.static-gcc... no
I note that the Makefile's CC variable is set to gcc, which doesn't sound like the proper compiler.
Then, I run make. It fails with errors:
collect2: error: ld returned 1 exit status
make[2]: *** [iperf3] Error 1
make[2]: Leaving directory `/home/snip/iperf3/iperf-3.1.4/src'
make[1]: *** [all] Error 2
make[1]: Leaving directory `/home/snip/iperf3/iperf-3.1.4/src'
make: *** [all-recursive] Error 1
I also see the line: libtool: warning: undefined symbols not allowed in i686-w64-mingw32.static shared libraries; building static only
I think that the ./configure is not working correctly since it appears to have not found the right compiler for my --host argument and put it in the Makefile.
What am I doing wrong?
EDIT:
I changed the command to ./configure --host=i686-w64-mingw32 per comments and it completes without error. But no makefile is created so make yields make: *** No targets specified and no makefile found. Stop.
What am I doing wrong, now?
EDIT 2:
Looks like the ./configure actually is failing. Last line of its output is nanosleep() required for timing operations., which seems to mean that its missing a library for nanosleep.
How do I get nanosleep?
mingw doesn't support nanosleep. So programs using it cannot be compiled using mingw-w64.

wxFreeChart and -mthreads

I’m trying to develop some plotting apps for Windows platform. I’m using Debian and built wxWidgets for cross-compiling as described here.
With MinGW compiler it works perfect and I have no problem with creating Win32 apps under Linux. But I faced some troubles with wxFreeChart.
I run ./configure --host=i386-mingw32 --with-wx-config=/usr/local/i586-mingw32/bin/wx-config
Then I run 'make' and getting error about
unrecognized command line option ‘-mthreads
Full output here:
~/dev/freechart/bk-deps g++ -c -o wxfreechart_lib_legend.o -I./include -I/usr/local/i586-mingw32/lib/wx/include/i586-mingw32msvc-msw-unicode-static-3.0 -I/usr/local/i586-mingw32/include/wx-3.0 -D_LARGEFILE_SOURCE=unknown -D__WXMSW__ -mthreads -O2 ./src/legend.cpp
g++: error: unrecognized command line option ‘-mthreads’
make: *** [wxfreechart_lib_legend.o] Error 1
The only advice I've seen was to remove '-mthreads' from code, but I have no idea where is it(
Problem described above is solved, but still no luck with building wxFreeChart.
Next errors I get were about some additional libs, which I finally solved by
CPPFLAGS="-I/usr/i586-mingw32msvc/include -I~/dev/wxWidgets-3.0.2/include" ./configure --host=i386-mingw32 --with-wx-config=/usr/local/i586-mingw32/bin/wx-config
I'm not sure that including .h from source folder ~/dev/wxWidgets is a good idea, but at least it solved some problems.
Now make crashing with messages like:
In file included from /usr/local/i586-mingw32/include/wx-3.0/wx/wx.h:17:0,
from ./include/wx/wxfreechartdefs.h:20,
from ./include/wx/legend.h:13,
from ./src/legend.cpp:10:
/usr/local/i586-mingw32/include/wx-3.0/wx/list.h: In constructor ‘wxListKey::wxListKey(const wxString&)’:
/usr/local/i586-mingw32/include/wx-3.0/wx/list.h:381:40: error: invalid use of incomplete type ‘class wxString’
or
/usr/local/i586-mingw32/include/wx-3.0/wx/containr.h:247:13: error: incomplete type ‘wxNavigationEnabled<wxControl>::BaseWindowClass {aka wxControl}’ used in nested name specifier
make: *** [wxfreechart_lib_legend.o] Error 1

scalpel - error when running ./configure

I've downloaded scalpel from github and ran
./configure
but I get the following error:
configure: creating ./config.status
config.status: error: cannot find input file: `Makefile.in
I've no idea what this means, I am missing some dependency or something?
Run ./bootstrap first. We just removed the configure script. It was checked in by mistake.
See also: https://github.com/sleuthkit/scalpel/issues/2

Resources