LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware > Linux - Embedded & Single-board computer
User Name
Password
Linux - Embedded & Single-board computer This forum is for the discussion of Linux on both embedded devices and single-board computers (such as the Raspberry Pi, BeagleBoard and PandaBoard). Discussions involving Arduino, plug computers and other micro-controller like devices are also welcome.

Notices


Reply
  Search this Thread
Old 10-26-2012, 07:07 AM   #1
ArnoStef
LQ Newbie
 
Registered: Oct 2012
Posts: 8

Rep: Reputation: Disabled
"top" - cross compile for arm or binaries available?


top in busybox isn't as functional as I need it. So I tried to compile "top" from source (http://procps.sourceforge.net/index.html)
It compiles on my ubuntu, but I couldn't crosscompile it.

make lib64=lib CC=arm-none-linux-gnueabi-gcc gives:
top.c:28: fatal error: curses.h: No such file or directory

while adding the dir with

make CC=arm-none-linux-gnueabi-gcc CPPFLAGS=-I/usr/include

cc1: warning: include location "/usr/include" is unsafe for cross-compilation
top.c:3385: error: impossible constraint in 'asm'

I have no clue how to solve this issue. Can you help? What am I doing wrong?

Is there maybe a source for Cortex-A8 binaries that I can use - whithout installing a hole new system on my embedded device?

Last edited by ArnoStef; 10-26-2012 at 07:08 AM.
 
Old 10-26-2012, 07:15 AM   #2
AnkurTank
LQ Newbie
 
Registered: Oct 2012
Posts: 13

Rep: Reputation: Disabled
I am not sure about this
I think you can try below ?
make ARCH=arm CC=arm-none-linux-gnueabi-gcc CPPFLAGS=-I/usr/include
it might work.
 
Old 10-26-2012, 09:22 AM   #3
ArnoStef
LQ Newbie
 
Registered: Oct 2012
Posts: 8

Original Poster
Rep: Reputation: Disabled
Thanks AnkurTank

make ARCH=arm CC=arm-none-linux-gnueabi-gcc CPPFLAGS=-I/usr/include

will probably use the internal curses lib, which doesn't fit to the architecture. I guess this is the problem.#
And what is about this message:
cc1: warning: include location "/usr/include" is unsafe for cross-compilation

I downloaded ncurses and did
./configure --host=arm-none-linux-gnueabi
./make

then I tried:
make CC=arm-none-linux-gnueabi-gcc CPPFLAGS=-I../ncurses-5.9/include LDFLAGS=-L../ncurses-5.9/lib

but

arm-none-linux-gnueabi-gcc -D_GNU_SOURCE -I proc -I../ncurses-5.9/include -fno-common -ffast-math -W -Wall -Wshadow -Wcast-align -Wredundant-decls -Wbad-function-cast -Wcast-qual -Wwrite-strings -Waggregate-return -Wstrict-prototypes -Wmissing-prototypes -O2 -s -Wdeclaration-after-statement -Wpadded -Wstrict-aliasing -fweb -frename-registers -fomit-frame-pointer -fno-inline-functions -c -o watch.o watch.c
watch.c:18: fatal error: ncurses.h: No such file or directory

And indeed - there is no ncurse.h in the ncurses-5.9/include path?!?

Last edited by ArnoStef; 10-26-2012 at 09:23 AM.
 
Old 10-26-2012, 06:36 PM   #4
theNbomr
LQ 5k Club
 
Registered: Aug 2005
Distribution: OpenSuse, Fedora, Redhat, Debian
Posts: 5,399
Blog Entries: 2

Rep: Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908
You will probably need to download either a curses-devel package, or download and build the ncurses package for your target architecture.

gcc is complaining when you point it to local include directories, since those are intended for the native compiler on your build host. I have 4 cross toolchains from various origins and three of them have ncurses.h installed in the sys-root of the toolchain. My ncurses-5.8 installation doesn't seem to have the header file either. I've lost track of whether I installed that package or not, but I wonder if the header file only gets created at install time.
You can re-configure your ncurses source package with the --prefix option, pointing --prefix to a non-system directory, such as the curses source tree itself. Then, make and make install the cross-compiled package. See if it creates an include directory with ncurses.h in it. If so, either copy the contents to the sys-root of your cross toolchain, or point to it with your gcc compiler args.

Another possibility is that since there is probably a curses shared object library on your target host filesystem, you might find the respective ncurses.h there.

And, now that I've looked at the arguments you are using, I wonder if they are correct. CPPFLAGS is typically used for the C preprocessor, but I always add include paths with CFLAGS:
Code:
gcc CFLAGS+=-I /some/include/path
--- rod.

Last edited by theNbomr; 10-26-2012 at 06:37 PM.
 
1 members found this post helpful.
Old 11-05-2012, 08:34 AM   #5
ArnoStef
LQ Newbie
 
Registered: Oct 2012
Posts: 8

Original Poster
Rep: Reputation: Disabled
Sorry for the delay in answering - have been ill.
I just compiled ncurses with

./configure --host=arm-none-linux-gnueabi
make

The missing lncurses.h is indeed created as a link with installing it. So I did this manually.

Additionally I compiled proc-tools with

make CC=arm-none-linux-gnueabi-gcc CPPFLAGS=-I../ncurses-5.9/include LDFLAGS=-L../ncurses-5.9/lib

Additionally I have to copy the created libproc-3.2.8.so to the device under test.
The problem now is, that calling top I get:

'vt102': unknown terminal type

Other programms that has been compiled (as free) seem to work fine.
 
Old 11-10-2015, 11:53 PM   #6
jissj
LQ Newbie
 
Registered: Nov 2015
Location: Sanda,Japan
Posts: 3

Rep: Reputation: Disabled
Arrow top command error

Quote:
Originally Posted by ArnoStef View Post
Sorry for the delay in answering - have been ill.
I just compiled ncurses with

./configure --host=arm-none-linux-gnueabi
make

The missing lncurses.h is indeed created as a link with installing it. So I did this manually.

Additionally I compiled proc-tools with

make CC=arm-none-linux-gnueabi-gcc CPPFLAGS=-I../ncurses-5.9/include LDFLAGS=-L../ncurses-5.9/lib

Additionally I have to copy the created libproc-3.2.8.so to the device under test.
The problem now is, that calling top I get:

'vt102': unknown terminal type

Other programms that has been compiled (as free) seem to work fine.
I have got a similar error when I am trying to run newly cross compiled top.
My error is "terminals database is inaccessible". I think both errors are due to terminal access problem. Did you fixed your issue? If so it will be help full for me also. Hope you will reply soon.
 
Old 11-11-2015, 02:38 AM   #7
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,850

Rep: Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309
no, that is no terminal access problem, but unknown terminal type. Terminal database contains the information related to the commands used to move cursor, scroll and similar. You may try to start top in xterm or other, known terminal emulator (at least I think so).
 
1 members found this post helpful.
Old 11-11-2015, 08:30 PM   #8
jissj
LQ Newbie
 
Registered: Nov 2015
Location: Sanda,Japan
Posts: 3

Rep: Reputation: Disabled
Unhappy

Quote:
Originally Posted by pan64 View Post
no, that is no terminal access problem, but unknown terminal type. Terminal database contains the information related to the commands used to move cursor, scroll and similar. You may try to start top in xterm or other, known terminal emulator (at least I think so).
I tried xterm too. But its same. I tried many terminal types such as linux,teraterm etc by changing environment variable TERM and in all case same error happened.
 
Old 11-12-2015, 01:47 AM   #9
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,850

Rep: Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309
because changing the variable will not change the capabilities the actual/real terminal you use.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
cross compile "poppler-0.10.7" error jeazh Linux - Newbie 2 06-14-2009 10:52 AM
How do you create shortcuts to "folders" and "binaries" in GNOME? ebenh Linux - Desktop 5 01-21-2008 05:28 AM
Where to download precompiled bash binaries, such as "time" and "top"? elinuxqs Linux - Newbie 12 11-14-2005 08:36 PM
Programs don't like "staying on top" or "always on top" -- any help? SBing Linux - Software 8 07-05-2004 04:41 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware > Linux - Embedded & Single-board computer

All times are GMT -5. The time now is 09:50 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration