Cygwin make error - makefile

I was compiling a source code, and it always fails at make command, below is the error message.
gcc: unrecognized option '-rdynamic'
/usr/lib/gcc/i686-pc-cygwin/4.5.3/../../../../i686-pc-cygwin/bin/ld: \
warning: --export-dynamic is not supported for PE targets, \
did you mean --export-all-symbols?
/usr/lib/gcc/i686-pc-cygwin/4.5.3/../../../../i686-pc-cygwin/bin/ld: \
warning: --export-dynamic is not supported for PE targets, \
did you mean --export-all-symbols?
make[3]: Leaving directory `/home/alimjan/slim502/src'
make[2]: Leaving directory `/home/alimjan/slim502/src'
make[1]: Leaving directory `/home/alimjan/slim502/src'
Making all in lib
make[1]: Entering directory `/home/alimjan/slim502/lib'
Cannot execute /bin/lmntal
Makefile:422: recipe for target `config.il' failed
make[1]: *** [config.il] Error 1
make[1]: Leaving directory `/home/alimjan/slim502/lib'
Makefile:293: recipe for target `all-recursive' failed
make: *** [all-recursive] Error 1
(Above lines broken to display)
I could not solve this. I am new to make and don't know what to do?

Usually when a makefile output looks as severe as your output, then it is because of the environment of which it is being used on has changed -- it could perhaps be that some external files have been moved or deleted or it could be that the make is too big, especially if the make is recursive in nature ( stay away from recursive makefiles; go NR)
Anyway if I where you I would look into where the environment had changed -- perhaps if your project is in a version system - try a different branch
Trying to solve the problems in the makefile could be very difficult and so it is better to go back to a version that worked and then move on from there

I'm not really sure this is a problem with the makefile. The error is:
Cannot execute /bin/lmntal
I'm fairly sure if you tried to run "/bin/lmntal" yourself from the command line you'd get a similar error. It seems that your build requires some extra utility in order to run, that you don't have or which isn't working on your system. Does that file (/bin/lmntal) exist? Is it executable? Is it a script and if so, does the first line refer to an interpreter that exists and is executable? Is it a 32bit program (use file /bin/lmntal) while you're using a 64bit operating system and if so, do you have the 32bit versions of libc, etc. installed on your Ubuntu system? Or vice versa (if you have a 32bit Ubuntu and the utility is a 64bit program you won't be able to run it at all)?
Alternatively it could be that this program is supposed to be found somewhere else or named something else, and your makefile is at fault because some variables are not set; for example the makefile could say something like $(FOODIR)/bin/lmntal and for some reason the variable $(FOODIR) is not set.
If you provide the details above (file exists? Permissions? file output? Complete rule at line 422 of the makefile?) we can provide more help.

Related

GCC - How to add support to a new architecture?

I am trying to learn how to port GCC to new architectures. Most tutorials say that I only have to create three files named my_processor.c my_processor.h and my_processor.md; however when running ./configure --target=my_processor machine is not recognized.
Following an answer given in How to write your own code generator backend for gcc?, I added my configuration in config.sub and ./configure worked.
Unfortunately, when I use make, the terminal returns an error saying
checking if mkdir takes one argument... no
*** Configuration my_processor-unknown-none not supported
Makefile:4230: recipe for target 'configure-gcc' failed
make[1]: *** [configure-gcc] Error 1
make[1]: Leaving directory 'objdir'
Makefile:905: recipe for target 'all' failed
make: *** [all] Error 2
The problem seems to be due to a bad configuration in gcc/config.gcc, maybe because I added my architecture in a wrong place (there are multiple case ${target}, so not sure which choose) or because I am missing something.
The only information that I have found appears in https://gcc.gnu.org/onlinedocs/gcc-4.2.2/gccint/Back-End.html, but it is not complete enough.
So, how could I do to avoid this error?
Krister Walfridsson's blog has a detailed description of all the steps needed to create a new backend. The first in the series is about the 8 kinds of files to be changed or created. It's also suggested to follow the logic for a Moxie backend that might be easier to start with than risc-v.

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.

Compiling GCC 4.7.3 for i386-elf support on Cygwin

I am trying to compile GCC for Cygwin with support for targeting i386-elf so I can compile some simple OSes (search Benu, by l30nard0, on Github). I've successfully compiled the binutils for i386-elf, and compiled all of GCC's floating-point numbers dependencies.
Problem is, it says windows.h can not be found. I do have w32api successfully installed, and tried including each of those one at a time in the include path for GCC, but none of them work. If I try any of them, I get so many errors and warnings that not all will show up in the Cygwin console. The dozens upon dozens of warnings are most if not all unused parameter.
Does anyone know where the problem might lie?
I've wasted the last three entire days of my life trying to get Linux Mint set up with everything I want, but for reasons I shan't go into I gave up on that. I'd love to be able to get just one thing to work so I can enjoy my life again. :) Thanks!
BTW: The configure arguments I used were --target=i386-elf --enable-threads=win32 --enable-languages=c,c++ Was I supposed to use --enable-targets instead?
And here's part of the log:
In file included from ../../../gcc/libgcc/gthr.h:150:0,
from ../../../gcc/libgcc/unwind-dw2.c:38:
./gthr-default.h:541:21: fatal error: windows.h: No such file or directory
compilation terminated.
../../../gcc/libgcc/static-object.mk:17: recipe for target 'unwind-dw2.o' failed
make[2]: *** [unwind-dw2.o] Error 1
make[2]: *** Waiting for unfinished jobs....
In file included from ../../../gcc/libgcc/gthr.h:150:0,
from ../../../gcc/libgcc/unwind-dw2-fde.c:38:
./gthr-default.h:541:21: fatal error: windows.h: No such file or directory
compilation terminated.
../../../gcc/libgcc/static-object.mk:17: recipe for target 'unwind-dw2-fde.o' failed
make[2]: *** [unwind-dw2-fde.o] Error 1
make[2]: Leaving directory '/home/Sean/gccbuild/i386-elf/libgcc'
Makefile:10055: recipe for target 'all-target-libgcc' failed
make[1]: *** [all-target-libgcc] Error 2
make[1]: Leaving directory '/home/Sean/gccbuild'
Makefile:870: recipe for target 'all' failed
make: *** [all] Error 2
Remove the --enable-threads=win32 flag; it is intended to specify thread support on the target system, not the build system.

installing isolated gcc on server without sudo

I have access to a server (but don't have root permissions on there). To cut a long story short the admin won't upgrade to the newer version of gcc that I need, but has suggested that I can just install it locally.
I'm having some issues doing this, despite trying to follow the guide at http://gcc.gnu.org/install/index.html. I want to use the new versions of GMP, MPFR, and MPC that are installed now on the server.
I first go into my home dir on the server then mkdir mygcc which I then cd into (this is to be the build dir and is not a sub-dir of src dir), from there I do
/home/username/gcc-4.6.3/configure --with-gmp="/software/gmp-5.0.5" --with-
gmp-include="/software/gmp-5.0.5/include" --with-gmp-lib="/software/gmp-5.0.5/lib"
--with-mpfr="/software/mpfr-3.1.1" --with-mpfr-include="/software/mpfr-3.1.1/include"
--with-mpfr-lib="/software/mpfr-3.1.1/lib" --with-mpc-include="/home/username/usr/local
/include" --with-mpc-lib="/home/username/usr/local/lib" --prefix="/home/username/mygcc"
--with-local-prefix="/home/username/usr/local"
the src files that I unzipped are at /home/pmxlh1/gcc-4.6.3.
I also made the directories /home/username/usr/include, /home/username/usr/local etc and set the prefix flags to try and install various things there, but it also fails if I just leave those flags out for the same reasons.
When I get to make however it ends with
checking for suffix of object files... configure: error: in `/home/pmxlh1/mygcc/x86_64-
unknown-linux-gnu/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 `/home/pmxlh1/mygcc'
make[1]: *** [stage1-bubble] Error 2
make[1]: Leaving directory `/home/pmxlh1/mygcc'
make: *** [all] Error 2
Not sure if I'm going about this the correct way? But basically I want to install it in my home/dir and so that it uses the correct GMP/MPFR/MPC not the old versions that maybe lurking elsewhere on the server.
thanks for any help

Why is 'make' failing on Lion?

I'm using make to build a large project on OSX Lion. The scripts worked fine on OSX up to Snow Leopard, but now it fails.
What happens is that after building certain modules, I get an error similar to the following:
touch my.app/Contents/Resources
touch my.app
make[2]: write error
make[1]: *** [all] Error 1
make: *** [all] Error 1
If I then type make again it resumes from where it fails and builds successfully (until it hits another such error). It always happens for the same two modules of the project, and I can't for the life of me work out why.
Please let me know if there's any more information I can provide that would be helpful.
1st Update
Here's the output of make -d:
...
Finished prerequisites of target file `DesktopConn.o'.
Prerequisite `DesktopConn.cxx' is older than target `DesktopConn.o'.
No need to remake target `DesktopConn.o'.
Considering target file `List.o'.
Looking for an implicit rule for `List.o'.
Trying pattern rule with stem `List'.
Trying implicit prerequisite `/bin/sh: line 1: 6733 Segmentation fault: 11 make all
Reaping losing child 0x102d0ae70 PID 6471
make[1]: *** [all] Error 1
Removing child 0x102d0ae70 PID 6471 from chain.
Reaping losing child 0x10560ee20 PID 6342
make: *** [all] Error 1
Removing child 0x10560ee20 PID 6342 from chain.
I've put the whole make -d output (extremely verbose) on pastebin.
2nd Update
I've uploaded the Makefile too.
3rd Update
I've downloaded the source for make, built from source on my machine. It still fails at the same point. I've also tried using the make binary from Snow Leopard.
Try taking the SEGV at face value. make is either dereferencing an out-of-bounds pointer, or trying to write memory somewhere out of bounds, or it is trying to extend the stack beyond the process stack size limit. There's nothing you can do about the first two without debugging GNU make, but you can increase the stack limit. Using bash:
ulimit -s hard
raises the soft limit to the hard limit, giving you as much stack space as possible. Try it and see if make can run to completion without crashing.
llvm is the default compiler in Lion, I believe, but was not in previous versions you mentioned. Occam's razor says try it using:
CC=gcc make
Edit:
Found this, which I think is related. See answer #1, 3 edits: here. It refers to building Ruby, but I think the underlying issue is the same. It's possible you'll need to download a different version of GCC if this is the issue.

Resources