Compiling issues on RHEL 6

18 views
Skip to first unread message

Sha

unread,
Nov 7, 2017, 8:11:42 AM11/7/17
to lemon-lang

This is what I see:

~/lemon(master+) $ cat /etc/redhat-release
Red Hat Enterprise Linux Server release 6.9 (Santiago)

~/lemon(master+) $ make STATIC=1
cc1: error: unrecognized command line option "-flto"
make: *** [obj/main.o] Error 1

~/lemon(master+) $ gcc --version
gcc (GCC) 4.4.7 20120313 (Red Hat 4.4.7-18)

When I remove the -flto option from the Makefile, it compiles with this error:

~/lemon(master+) $ make STATIC=1
CC ./src/main.c

...
...
CC ./src/lcontinuation.c
CC ./lib/builtin.c
CC ./lib/os.c
CC ./lib/socket.c
make: gcc-ar: Command not found
make: *** [liblemon.a] Error 127


But if I do:

~/lemon(master+) $ make
...
...
CC liblemon.so
cc -std=c89 -pedantic -Wall -Wextra -Wno-unused-parameter -I. -I./src -DLINUX -D_XOPEN_SOURCE=700 -D_GNU_SOURCE -fPIC -O2 -DNDEBUG -DMODULE_OS -DMODULE_SOCKET obj/main.o liblemon.so -L. -llemon -lm -Wl,-rpath=./ -ldl -o lemon
CC lemon

It compiles without any issues. I do not know if removing -flto will have any runtime consequences.


admin

unread,
Nov 7, 2017, 8:17:19 AM11/7/17
to lemon-lang
your gcc is too old.
Reply all
Reply to author
Forward
0 new messages