Click here to Skip to main content
15,860,859 members
Home / Discussions / Linux Programming
   

Linux Programming

 
GeneralRe: Why lscpu returns BOTH 32 -bit , 64-bit ? Pin
Vaclav_1-Apr-19 6:42
Vaclav_1-Apr-19 6:42 
QuestionHow to "include / link " to libbluetooth-dev (package?) ? Pin
Vaclav_1-Apr-19 5:33
Vaclav_1-Apr-19 5:33 
AnswerRe: How to "include / link " to libbluetooth-dev (package?) ? Pin
Richard MacCutchan1-Apr-19 5:49
mveRichard MacCutchan1-Apr-19 5:49 
GeneralSOLVED Re: How to "include / link " to libbluetooth-dev (package?) ? Pin
Vaclav_1-Apr-19 6:42
Vaclav_1-Apr-19 6:42 
QuestionAnybody feels like dissecting / discussing "Linux" STANDARD "configure" script / file? Pin
Vaclav_27-Mar-19 10:31
Vaclav_27-Mar-19 10:31 
AnswerRe: Anybody feels like dissecting / discussing "Linux" STANDARD "configure" script / file? Pin
k505427-Mar-19 12:18
mvek505427-Mar-19 12:18 
GeneralRe: Anybody feels like dissecting / discussing "Linux" STANDARD "configure" script / file? Pin
Vaclav_27-Mar-19 16:24
Vaclav_27-Mar-19 16:24 
GeneralRe: Anybody feels like dissecting / discussing "Linux" STANDARD "configure" script / file? Pin
k505427-Mar-19 21:36
mvek505427-Mar-19 21:36 
Stop using sudo for everything. That's like using Run as Administrator all the time.

As it happens, I do know what I'm talking about. As an example I'll cross compile grep for you. grep does have an optional dependency on libpcre - perl regular expressions, which I won't complicate this by also compiling. Fortunately we can disable that by using --disable-perl-regex
$ ls
grep-3.0  grep-3.0.tar.xz
configure can build in a directory other than the source directory, so lets do that.  We'll use --prefx=$HOME/apt so we don't need to use sudo to install.
$ mkdir build
$ cd build
$ ../grep-3.0/configure --host=arm-linux-gnueabihf --prefix=$HOME/arm --disable-perl-regexp > configure.out 2>&1 && echo Success || echo Failed
Success
did we configure for cross compile?
$ grep cross configure.out
checking whether we are cross compiling... yes
checking for working fcntl.h... cross-compiling
lets make and install ...
$ make > make.out 2>&1 && echo Success || echo Failure
Success
$ ls $HOME/arm
ls: cannot access '/home/k5054/arm': No such file or directory
$ make install > make_install.out 2>&1 && echo Success || echo Failure
Success
so far so good ... lets see what I have in $HOME/arm
$ cd $HOME/arm
$ ls
bin  share
$ cd bin
$ ls
egrep  fgrep  grep
$ file *
egrep: POSIX shell script, ASCII text executable
fgrep: POSIX shell script, ASCII text executable
grep:  ELF 32-bit LSB shared object, ARM, EABI5 version 1 (SYSV), dynamically linked, interpreter /lib/ld-, for GNU/Linux 3.2.0, BuildID[sha1]=b44e80774f0b6413d50f10c1bd7f57d10e88a6af, with debug_info, not stripped
so we've got an ARM EABI5 executable for $HOME/arm/bin/grep.  how does that compare to /bin/grep?
$ file /bin/grep
/bin/grep: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 2.6.32, BuildID[sha1]=0b72a4b88afe6711c7154541e1f002331041c71f, stripped
so that's an X86_64 executable ... things are looking good, lets copy that over to the pi and see if it will work
$ scp -r -q arm pi3:
$ ssh pi3
Linux pi3 4.14.98-v7+ #1200 SMP Tue Feb 12 20:27:48 GMT 2019 armv7l
Last login: Thu Mar 28 00:33:06 2019 from 192.168.235.202
lets test arm/bin/grep
k5054@pi3:~ $ ./arm/bin/grep --version
grep (GNU grep) 3.0
Copyright (C) 2017 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Written by Mike Haertel and others, see <http://git.sv.gnu.org/cgit/grep.git/tree/AUTHORS>.
that worked! how does that compare to /bin/grep?
k5054@pi3:~ $ /bin/grep --version
grep (GNU grep) 2.27
Copyright (C) 2016 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Written by Mike Haertel and others, see <http://git.sv.gnu.org/cgit/grep.git/tree/AUTHORS>.
it's a different version, very good! - now lets try a grep pattern, and count the number of times the word "is" appears in the version text of /bin/grep
k5054@pi3:~ $ /bin/grep --version | arm/bin/grep -c '\<is\>'
2
looks like my cross-compiled grep is working fine 
k5054@pi3:~ $ logout
well, looks like that all worked -- seems --host=arm-linux-gnueabihf is the right thing after all
JokeSOLVED ABANDONED building library file using "blues" package is futile Pin
Vaclav_22-Mar-19 7:48
Vaclav_22-Mar-19 7:48 
AnswerRe: linker error file not recognized: File format not recognized Pin
k505422-Mar-19 8:05
mvek505422-Mar-19 8:05 
GeneralRe: linker error file not recognized: File format not recognized Pin
Vaclav_22-Mar-19 13:27
Vaclav_22-Mar-19 13:27 
GeneralRe: linker error file not recognized: File format not recognized Pin
Richard MacCutchan22-Mar-19 22:53
mveRichard MacCutchan22-Mar-19 22:53 
GeneralRe: linker error file not recognized: File format not recognized Pin
Vaclav_23-Mar-19 5:10
Vaclav_23-Mar-19 5:10 
GeneralRe: linker error file not recognized: File format not recognized Pin
Richard MacCutchan23-Mar-19 5:36
mveRichard MacCutchan23-Mar-19 5:36 
GeneralRe: linker error file not recognized: File format not recognized Pin
k505423-Mar-19 5:51
mvek505423-Mar-19 5:51 
GeneralRe: linker error file not recognized: File format not recognized Pin
Vaclav_23-Mar-19 6:48
Vaclav_23-Mar-19 6:48 
GeneralRe: linker error file not recognized: File format not recognized Pin
Richard MacCutchan23-Mar-19 7:15
mveRichard MacCutchan23-Mar-19 7:15 
GeneralRe: linker error file not recognized: File format not recognized Pin
Vaclav_23-Mar-19 10:50
Vaclav_23-Mar-19 10:50 
GeneralRe: linker error file not recognized: File format not recognized Pin
k505423-Mar-19 8:16
mvek505423-Mar-19 8:16 
GeneralRe: linker error file not recognized: File format not recognized Pin
Vaclav_23-Mar-19 10:38
Vaclav_23-Mar-19 10:38 
GeneralRe: linker error file not recognized: File format not recognized Pin
k505423-Mar-19 11:35
mvek505423-Mar-19 11:35 
GeneralRe: linker error file not recognized: File format not recognized Pin
Vaclav_23-Mar-19 16:32
Vaclav_23-Mar-19 16:32 
GeneralChange package architecture - no go Pin
Vaclav_24-Mar-19 5:45
Vaclav_24-Mar-19 5:45 
GeneralRe: Change package architecture - no go Pin
k505424-Mar-19 8:34
mvek505424-Mar-19 8:34 
GeneralRe: Change package architecture - no go Pin
Vaclav_24-Mar-19 13:24
Vaclav_24-Mar-19 13:24 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.