FOREWORD : My build system is based on Ubuntu 14.04 LTS server edition
I have bumped into a common issue while cross-compiling binutils for the arm-none-eabi toolchain.
After downloading the sources from :
https://launchpad.net/gcc-arm-embedded/4.8/4.8-2014-q3-update/+download/gcc-arm-none-eabi-4_8-2014q3-20140805-src.tar.bz2
I extracted the tarball and patched zlib with :
$ cd ./gcc-arm-none-eabi-4_8-2014q3-20140805/src
$ find -name '*.tar.*' | xargs -I% tar -xf %
$ cd zlib-1.2.5
$ patch -p1 <../zlib-1.2.5.patch
$ cd ../../
according to the instructions of the bundled PDF guide. I then applied this sed patch :
sed -i -e 's/#colophon/##colophon/' -e 's/doc#cygnus.com/doc##cygnus.com/' bfd/doc/bfd.texinfo
and launched the ./build-prerequisites.sh --skip_mingw32 and ./build-toolchain.sh --skip_mingw32 scripts.
Altough the ./build-prerequisites.sh --skip_mingw32 works fine, the toolchain script ends with an error in the binutils install procedure :
/home/arturo/ARM_CROSS/gcc-arm-none-eabi-4_8-2014q3-20140805/src/binutils/binutils/doc/binutils.texi:4416: warning: #itemx should not begin #table
/home/arturo/ARM_CROSS/gcc-arm-none-eabi-4_8-2014q3-20140805/src/binutils/binutils/doc/binutils.texi:4424: #itemx must follow #item
/home/arturo/ARM_CROSS/gcc-arm-none-eabi-4_8-2014q3-20140805/src/binutils/binutils/doc/binutils.texi:4428: #itemx must follow #item
/home/arturo/ARM_CROSS/gcc-arm-none-eabi-4_8-2014q3-20140805/src/binutils/binutils/doc/binutils.texi:4434: #itemx must follow #item
/home/arturo/ARM_CROSS/gcc-arm-none-eabi-4_8-2014q3-20140805/src/binutils/binutils/doc/binutils.texi:4438: #itemx must follow #item
/home/arturo/ARM_CROSS/gcc-arm-none-eabi-4_8-2014q3-20140805/src/binutils/binutils/doc/binutils.texi:4448: #itemx must follow #item
/home/arturo/ARM_CROSS/gcc-arm-none-eabi-4_8-2014q3-20140805/src/binutils/binutils/doc/binutils.texi:2404: warning: node next `ranlib' in menu `readelf' and in sectioning `size' differ
/home/arturo/ARM_CROSS/gcc-arm-none-eabi-4_8-2014q3-20140805/src/binutils/binutils/doc/binutils.texi:2482: warning: node prev `size' in menu `readelf' and in sectioning `ranlib' differ
/home/arturo/ARM_CROSS/gcc-arm-none-eabi-4_8-2014q3-20140805/src/binutils/binutils/doc/binutils.texi:2706: warning: node next `strip' in menu `elfedit' and in sectioning `c++filt' differ
/home/arturo/ARM_CROSS/gcc-arm-none-eabi-4_8-2014q3-20140805/src/binutils/binutils/doc/binutils.texi:3259: warning: node next `nlmconv' in menu `windres' and in sectioning `windmc' differ
/home/arturo/ARM_CROSS/gcc-arm-none-eabi-4_8-2014q3-20140805/src/binutils/binutils/doc/binutils.texi:3364: warning: node next `windmc' in menu `dlltool' and in sectioning `windres' differ
/home/arturo/ARM_CROSS/gcc-arm-none-eabi-4_8-2014q3-20140805/src/binutils/binutils/doc/binutils.texi:3364: warning: node prev `windmc' in menu `windres' and in sectioning `nlmconv' differ
/home/arturo/ARM_CROSS/gcc-arm-none-eabi-4_8-2014q3-20140805/src/binutils/binutils/doc/binutils.texi:3525: warning: node next `windres' in menu `windmc' and in sectioning `dlltool' differ
/home/arturo/ARM_CROSS/gcc-arm-none-eabi-4_8-2014q3-20140805/src/binutils/binutils/doc/binutils.texi:3525: warning: node prev `windres' in menu `nlmconv' and in sectioning `windmc' differ
/home/arturo/ARM_CROSS/gcc-arm-none-eabi-4_8-2014q3-20140805/src/binutils/binutils/doc/binutils.texi:3719: warning: node next `dlltool' in menu `Common Options' and in sectioning `readelf' differ
/home/arturo/ARM_CROSS/gcc-arm-none-eabi-4_8-2014q3-20140805/src/binutils/binutils/doc/binutils.texi:3719: warning: node prev `dlltool' in menu `windmc' and in sectioning `windres' differ
/home/arturo/ARM_CROSS/gcc-arm-none-eabi-4_8-2014q3-20140805/src/binutils/binutils/doc/binutils.texi:4122: warning: node next `readelf' in menu `size' and in sectioning `elfedit' differ
/home/arturo/ARM_CROSS/gcc-arm-none-eabi-4_8-2014q3-20140805/src/binutils/binutils/doc/binutils.texi:4122: warning: node prev `readelf' in menu `ranlib' and in sectioning `dlltool' differ
/home/arturo/ARM_CROSS/gcc-arm-none-eabi-4_8-2014q3-20140805/src/binutils/binutils/doc/binutils.texi:4376: warning: node next `elfedit' in menu `c++filt' and in sectioning `Common Options' differ
/home/arturo/ARM_CROSS/gcc-arm-none-eabi-4_8-2014q3-20140805/src/binutils/binutils/doc/binutils.texi:4376: warning: node prev `elfedit' in menu `strip' and in sectioning `readelf' differ
/home/arturo/ARM_CROSS/gcc-arm-none-eabi-4_8-2014q3-20140805/src/binutils/binutils/doc/binutils.texi:4470: warning: node prev `Common Options' in menu `dlltool' and in sectioning `elfedit' differ
make[3]: *** [binutils.html] Error 1
make[3]: Leaving directory `/home/arturo/ARM_CROSS/gcc-arm-none-eabi-4_8-2014q3-20140805/build-native/binutils/binutils/doc'
Making html in po
make[3]: Entering directory `/home/arturo/ARM_CROSS/gcc-arm-none-eabi-4_8-2014q3-20140805/build-native/binutils/binutils/po'
make[3]: Nothing to be done for `html'.
make[3]: Leaving directory `/home/arturo/ARM_CROSS/gcc-arm-none-eabi-4_8-2014q3-20140805/build-native/binutils/binutils/po'
make[3]: Entering directory `/home/arturo/ARM_CROSS/gcc-arm-none-eabi-4_8-2014q3-20140805/build-native/binutils/binutils'
make[3]: Nothing to be done for `html-am'.
make[3]: Leaving directory `/home/arturo/ARM_CROSS/gcc-arm-none-eabi-4_8-2014q3-20140805/build-native/binutils/binutils'
make[2]: *** [html-recursive] Error 1
make[2]: Leaving directory `/home/arturo/ARM_CROSS/gcc-arm-none-eabi-4_8-2014q3-20140805/build-native/binutils/binutils'
make[1]: *** [html-binutils] Error 1
make[1]: Leaving directory `/home/arturo/ARM_CROSS/gcc-arm-none-eabi-4_8-2014q3-20140805/build-native/binutils'
make: *** [do-install-html] Error 2
I have also edited the second script by replacing the make calls with the make MAKEFINFO=true ones but I get this error...
....any suggestions about it ? I have been googling around so far and found that these ones are common problems occuring when working with the Ubuntu distros, but I still can't find a solution.
Thanks in advance, Arturo
Related
Following the official HTK Unix/Linux installation guide, I had similar issues to the ones described in this thread when trying to run make all on HTK. I had initially been looking at the wrong Makefile (/htk-3.4.1/Makefile), as suggested by MadScientist. After fixing the extra indentation on line 77 in the correct Makefile (/htk-3.4.1/HLMTools/Makefile) generated by running ./configure --prefix=/tmp, the HTK compile error:
Makefile:77: *** missing separator (did you mean TAB instead of 8 spaces?). Stop.
has disappeared, but I am still unable to compile on make all:
$ make all
(cd HTKTools && make all) \
|| case "" in *k*) fail=yes;; *) exit 1;; esac;
make[1]: Entering directory '/home/zeesy/htk-3.4.1/HTKTools'
make[1]: Nothing to be done for 'all'.
make[1]: Leaving directory '/home/zeesy/htk-3.4.1/HTKTools'
(cd HLMTools && make all) \
|| case "" in *k*) fail=yes;; *) exit 1;; esac;
make[1]: Entering directory '/home/zeesy/htk-3.4.1/HLMTools'
make[1]: Nothing to be done for 'all'.
make[1]: Leaving directory '/home/zeesy/htk-3.4.1/HLMTools'
Prior to make all, running ./configure --prefix=/tmp results in the error:
config.status: WARNING: HLMTools/Makefile.in seems to ignore the --datarootdir setting
for HTKLib, HLMLib, HTKTools and HLMTools. It also resets line 77 of the Makefile to quadruple indented tabs.
I have gcc-multilib installed. Based on this post, I installed libc6:i386 zlib1g:i386 lib32ncurses5 and lib32z1 in order to run this 32bit program on a 64bit computer.
Has anyone run into this problem? Step 4 of the VoxForge HTK install guide suggests that gcc 3.4 compiler compatibility modules are required.
As suggested by MadScientist, I was at first looking at the wrong Makefile. I had been looking at /htk-3.1.4/Makefile, when the file that needed to be edited was /htk-3.1.4/HLMTools/Makefile. A case of not reading the error messages thoroughly.
After getting the same error message for line 77
missing separator (did you mean TAB instead of 8 spaces?).
I ran Spaces to Tabs in Atom, and corrected the quadruple tab in the default Makefile.
The make all command initially ran successfully, but as I was unable to access ls /tmp/bin.linux I attempted make all again and received the second error message
make[1]: Nothing to be done for 'all'
The fix for this was to run make clean (see this post). However, Nikolay Shmyrev has pointed out that this error means that everything has compiled, there for there is 'nothing to be done'.
I'm now having problems accessing /tmp/bin.linux but will deal with that elsewhere.
SUMMARY: The make[1]: Nothing to be done for 'all' error means that everything has already compiled.
I have downloaded some very famous examples modules of linux kernel from http://examples.oreilly.com/9780596005900/
and tries to compile on my system.
My system info:
cat /etc/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=12.04
DISTRIB_CODENAME=precise
DISTRIB_DESCRIPTION="Ubuntu 12.04.5 LTS"
uname -a
Linux user 3.13.0-32-generic #57~precise1-Ubuntu SMP Tue Jul 15 03:51:20 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux
cd example/simple
make
Got error
make -C /lib/modules/3.13.0-32-generic/build M=/home/user/projects/self/examples/simple LDDINCDIR=/home/user/projects/self/examples/simple/../include modules
make[1]: Entering directory `/usr/src/linux-headers-3.13.0-32-generic'
/usr/src/linux-headers-3.13.0-32-generic/arch/x86/Makefile:98: stack protector enabled but no compiler support
/usr/src/linux-headers-3.13.0-32-generic/arch/x86/Makefile:113: CONFIG_X86_X32 enabled but no binutils support
scripts/Makefile.build:49: *** CFLAGS was changed in "/home/user/projects/self/examples/simple/Makefile". Fix it to use ccflags-y. Stop.
make[1]: *** [_module_/home/user/projects/self/examples/simple] Error 2
make[1]: Leaving directory `/usr/src/linux-headers-3.13.0-32-generic'
make: *** [default] Error 2
I came to know that now kernel build system does not allow to change CFLAGS outside of kernel so changes Makefile this way
-CFLAGS += $(DEBFLAGS) -I$(LDDINCDIR)
+ccflags-y += $(DEBFLAGS) -I$(LDDINCDIR)
Now again Make and get below error messages
make -C /lib/modules/3.13.0-32-generic/build M=/home/user/projects/self/examples/simple LDDINCDIR=/home/user/projects/self/examples/simple/../include modules
make[1]: Entering directory `/usr/src/linux-headers-3.13.0-32-generic'
/usr/src/linux-headers-3.13.0-32-generic/arch/x86/Makefile:98: stack protector enabled but no compiler support
/usr/src/linux-headers-3.13.0-32-generic/arch/x86/Makefile:113: CONFIG_X86_X32 enabled but no binutils support
CC [M] /home/user/projects/self/examples/simple/simple.o
cc1: error: unrecognized command line option "-m64"
cc1: error: unrecognized command line option "-mno-mmx"
cc1: error: unrecognized command line option "-mno-sse"
cc1: error: unrecognized command line option "-mno-red-zone"
cc1: error: unrecognized command line option "-mcmodel=kernel"
cc1: error: unrecognized command line option "-maccumulate-outgoing-args"
make[2]: *** [/home/user/projects/self/examples/simple/simple.o] Error 1
make[1]: *** [_module_/home/user/projects/self/examples/simple] Error 2
make[1]: Leaving directory `/usr/src/linux-headers-3.13.0-32-generic'
make: *** [default] Error 2
earlier I have compiled these example succusfully on my 32 bit system but now i moved to 64 bit system and facing this errors. I have googled about these errors but nothing helped till yet.
Let me how can i solved this compilation errors.
If you have spaces in your the directory you're compiling from or in the directory that contains your kernel sources, try removing them and make again.
If you don't have spaces in your compile directory and you're still getting this error, your kernel compilation may be failing because its directory belongs to root and you're running as an unprivileged user. Try sudo make.
I need to link libpotrace and compile it into libgerbv. What should I write in Makefile.am? I tried various things like LDADD, LIBDIR, LDFLAGS etc., but I was not successful.
How my structure look like:
gerbv/gerbv-test -> files from git, master brach
gerbv/libs/potrace/potrace-test -> potrace -> files from sourceforge.com, latest release
I use Debian Jessie, I can compile both programs separately, both I did not figured out, how can I link potrace to gerbv and compile it. The header file (.h) is included properly, but I haven't had any success with linking .so or .a/la lib. Even no success with installed potrace in /usr/local/lib or /usr/lib.
Can anyone direct me? The best will be if you can download both programs, compile it without error and then write what you put into the gerbv/src/makefile.Am.
UPDATED
I dowloaded clean releases and did this ONLY this modifies:
/root/NBP/gerbv/gerbv-test/src/Makefile.am
added
libgerbv_la_LIBADD = libpotrace.la # src/Makefile.am:84: error: use 'libgerbv_la_LIBADD', not 'libgerbv_la_LDADD'
libgerbv_la_LIBDIR = /root/NBP/gerbv/libs/potrace/potrace-old/src/.libs
#libgerbv_la_DEPENDENCIES = libpotrace.la
/root/NBP/gerbv/gerbv-test/src/exportimage.c
added at the top
#include "../../libs/potrace/potrace-test/src/potracelib.h"
added into void exportimage_render_to_surface_and_destroy(...), this will test, if the shared lib is properly linked. exportimage.c is part of libgerbv where I need to include libpotrace.
char *v = potrace_version();
After doing this modifications I build it via:
libpotrace
root:~/NBP/gerbv/libs/potrace/potrace-test# autoreconf && ./configure --with-libpotrace && make
runs without a problem...
gerbv/libgerbv
root:~/NBP/gerbv/gerbv-test# autoreconf && ./configure && make
This results with:
...
make[3]: Entering directory '/root/NBP/gerbv/gerbv-test/src'
make[3]: *** No rule to make target 'libpotrace.la', needed by 'libgerbv.la'. Stop.
make[3]: Leaving directory '/root/NBP/gerbv/gerbv-test/src'
Makefile:498: recipe for target 'all' failed
make[2]: *** [all] Error 2
make[2]: Leaving directory '/root/NBP/gerbv/gerbv-test/src'
Makefile:472: recipe for target 'all-recursive' failed
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory '/root/NBP/gerbv/gerbv-test'
Makefile:401: recipe for target 'all' failed
make: *** [all] Error 2
Solved with this Makefile.am addition:
libgerbv_la_LIBADD = ../../libs/potrace/potrace/src/libpotrace.la
libgerbv_la_DEPENDENCIES = ../../libs/potrace/potrace/src/libpotrace.la
I'm having a issue with
https://github.com/uzyszkodnik/rootkit
I'm trying to make it work as I'm modifying it for my class but I want to keep the file hider and it's not working when I compile it against CentOS 6.x
It throws this error:
error: implicit declaration of function ‘dentry_path_raw’
Here is the full error:
make -C /lib/modules/`uname -r`/build M=`pwd` modules
make[1]: Entering directory `/usr/src/kernels/2.6.32-504.8.1.el6.x86_64.debug'
CC [M] /root/rootkit.o
/root/rootkit.c: In function ‘file_hider’:
/root/rootkit.c:283: error: implicit declaration of function ‘dentry_path_raw’
/root/rootkit.c:283: warning: assignment makes pointer from integer without a cast
make[2]: *** [/root/rootkit.o] Error 1
make[1]: *** [_module_/root] Error 2
make[1]: Leaving directory `/usr/src/kernels/2.6.32-504.8.1.el6.x86_64.debug'
make: *** [default] Error 2
Any ideas how to fix this?
I am trying to compile Systrace-1.6f on Ubuntu 12.04 32bit edition. I found below error.
root#sharma-VM:/home/sharma/Desktop/systrace-1.6f# make
make all-recursive
make[1]: Entering directory `/home/sharma/Desktop/systrace-1.6f'
Making all in .
make[2]: Entering directory `/home/sharma/Desktop/systrace-1.6f'
gcc -DHAVE_CONFIG_H -I. -Wall -c systrace-translate.c
In file included from systrace-translate.c:54:0:
linux_fcntl.h:90:2: error: unknown type name ‘linux_off_t’
linux_fcntl.h:91:2: error: unknown type name ‘linux_off_t’
linux_fcntl.h:92:2: error: unknown type name ‘linux_pid_t’
linux_fcntl.h:98:9: error: unknown type name ‘linux_loff_t’
linux_fcntl.h:99:9: error: unknown type name ‘linux_loff_t’
linux_fcntl.h:100:9: error: unknown type name ‘linux_pid_t’
make[2]: *** [systrace-translate.o] Error 1
make[2]: Leaving directory `/home/sharma/Desktop/systrace-1.6f'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/sharma/Desktop/systrace-1.6f'
make: *** [all] Error 2
Please kindly suggest me a solution for the above error.
This question about particular program is too specific to be asked on SO. However I came across the same problem and that is how I found it.
grep is your helper! You can grep -rsli linux_off_t to find out that it is in linux_types.h. Another question why it doesn't work, but if you just want to go further, insert the following lines
#undef _LINUX_TYPES_H
#include "linux_types.h"
somewhere in the beginning of linux_fcntl.h.
Then you'll come across yet another issue. Replace all references to cs with xcs. It took me a while since I used assembler last time. So I don't know if that is how this register is called these days but that is what I see for struct user_regs_struct in /usr/include/i386-linux-gnu/sys/user.h.
Even with all that it still does not pass the second regression test.
systrace has not been updated for quite a while and perhaps is not quite compatible with 3.x kernels as is. I am not a kernel expert though.