LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 11-14-2014, 10:26 AM   #1
jena_arch
LQ Newbie
 
Registered: Nov 2014
Location: IAvkluRmyxpOticFnjXFXweKTFDSJYBktlLkFHRbTFwCuqvqCz
Distribution: IAvkluRmyxpOticFnjXFXweKTFDSJYBktlLkFHRbTFwCuqvqCz
Posts: 3

Rep: Reputation: 0
Coreutils recompilation


Hello everybody, that's my 1st post, I hope I won't do anything wrong.. (sorry for my not british-english language)

My problem:
I have to recompile coreutils on arch linux
- with debug symbols
- without doing any binary stripping
- forcing the use of frame pointer register

besides I've alredy done that for glibc, and fortunately it worked, but the same commands didn't do the same for coreutils

Here what I did with glibc:


Code:
git clone git://sourceware.org/git/glibc.git
cd glibc
git checkout --track -b local_glibc-2.20 master
mkdir build_glibc
cd build_glibc
../glibc-2.20/configure CFLAGS='-g -Og -fno-omit-frame-pointer -ggdb3' --prefix=/usr
make -j 8
make install -j 8


and here what I get:
Code:
file /usr/lib/libc-2.20.so
(ELF 64-bit … dynamically linked … not stripped !)
Code:
readelf --debug-dump /usr/lib/libc-2.20.so | less -Mr
(more or less 3'484'620 rows, brilliant!)


For coreutils:
Code:
wget -c http://ftp.gnu.org/gnu/coreutils/coreutils-8.23.tar.xz
tar -xvJf coreutils-8.23.tar.xz
./configure CFLAGS='-g -Og -fno-omit-frame-pointer -ggdb3'
make -j 8
make install -j 8


but ...
Code:
file /bin/ls
(/bin/ls: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.32, BuildID[sha1]=... ... ..., stripped )

(oh no it's stripped and there aren't symbols!)

thank you,
jena_arch

Last edited by jena_arch; 11-14-2014 at 10:49 AM. Reason: i forgot [code][/code] tags
 
Old 11-14-2014, 06:31 PM   #2
Keith Hedger
Senior Member
 
Registered: Jun 2010
Location: Wiltshire, UK
Distribution: Void, Linux From Scratch, Slackware64
Posts: 3,152

Rep: Reputation: 856Reputation: 856Reputation: 856Reputation: 856Reputation: 856Reputation: 856Reputation: 856
It is probably the makefile doing the stripping automatically,, have a look there first, why do you 'HAVE' to build it with out striping etc, if this is homework then please say so.
 
Old 11-15-2014, 03:12 AM   #3
jena_arch
LQ Newbie
 
Registered: Nov 2014
Location: IAvkluRmyxpOticFnjXFXweKTFDSJYBktlLkFHRbTFwCuqvqCz
Distribution: IAvkluRmyxpOticFnjXFXweKTFDSJYBktlLkFHRbTFwCuqvqCz
Posts: 3

Original Poster
Rep: Reputation: 0
Thank you for your answer Keith Hedger,
it's not properly a homework, it' more like a optional exercise in three parts (that one which I posted is just one of them) suggested by my o.s. professor for those who want to go beyond the mere teaching..

Quote:
It is probably the makefile doing the stripping automatically
saying that are you saying "there is no way avoiding stripping" or I can give to make command arguments to avoid it?

I tried
Code:
make --help
but it wasn't enlighten..
Quote:
Usage: make [options] [target] ...
Options:
-b, -m Ignored for compatibility.
-B, --always-make Unconditionally make all targets.
-C DIRECTORY, --directory=DIRECTORY
Change to DIRECTORY before doing anything.
-d Print lots of debugging information.
--debug[=FLAGS] Print various types of debugging information.
-e, --environment-overrides
Environment variables override makefiles.
--eval=STRING Evaluate STRING as a makefile statement.
-f FILE, --file=FILE, --makefile=FILE
Read FILE as a makefile.
-h, --help Print this message and exit.
-i, --ignore-errors Ignore errors from recipes.
-I DIRECTORY, --include-dir=DIRECTORY
Search DIRECTORY for included makefiles.
-j [N], --jobs[=N] Allow N jobs at once; infinite jobs with no arg.
-k, --keep-going Keep going when some targets can't be made.
-l [N], --load-average[=N], --max-load[=N]
Don't start multiple jobs unless load is below N.
-L, --check-symlink-times Use the latest mtime between symlinks and target.
-n, --just-print, --dry-run, --recon
Don't actually run any recipe; just print them.
-o FILE, --old-file=FILE, --assume-old=FILE
Consider FILE to be very old and don't remake it.
-O[TYPE], --output-sync[=TYPE]
Synchronize output of parallel jobs by TYPE.
-p, --print-data-base Print make's internal database.
-q, --question Run no recipe; exit status says if up to date.
-r, --no-builtin-rules Disable the built-in implicit rules.
-R, --no-builtin-variables Disable the built-in variable settings.
-s, --silent, --quiet Don't echo recipes.
-S, --no-keep-going, --stop
Turns off -k.
-t, --touch Touch targets instead of remaking them.
--trace Print tracing information.
-v, --version Print the version number of make and exit.
-w, --print-directory Print the current directory.
--no-print-directory Turn off -w, even if it was turned on implicitly.
-W FILE, --what-if=FILE, --new-file=FILE, --assume-new=FILE
Consider FILE to be infinitely new.
--warn-undefined-variables Warn when an undefined variable is referenced.

This program built for x86_64-unknown-linux-gnu
Report bugs to <bug-make@gnu.org>
what should I do?
 
Old 11-15-2014, 04:52 AM   #4
Keith Hedger
Senior Member
 
Registered: Jun 2010
Location: Wiltshire, UK
Distribution: Void, Linux From Scratch, Slackware64
Posts: 3,152

Rep: Reputation: 856Reputation: 856Reputation: 856Reputation: 856Reputation: 856Reputation: 856Reputation: 856
Well to start make --help gives help info for the make program, which is controlled by a makefile which in turn does the actual compiling/installing etc, so in this case 'make --help' doesn't really help, some make files have a 'help' target which can hold useful info wnad would be used like so:
Code:
 make help
but this is far from the norm, and is not available in coreutils.

Usually the strip is done separately from the make/install, again not always.

I have had a look at the makefile, it does no stripping, also the commands you give:
Code:
./configure CFLAGS='-g -Og -fno-omit-frame-pointer -ggdb3'
make -j 8
make install DESTDIR=/tmp/xxxx
And they work fine and give this:
Code:
file /tmp/xxxx/usr/local/bin/ls
/tmp/xxxx/usr/local/bin/ls: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.32, not stripped
So maybe use the DESTDIR=xxx method to make sure you are checking the right file?
 
1 members found this post helpful.
Old 11-16-2014, 04:14 PM   #5
jena_arch
LQ Newbie
 
Registered: Nov 2014
Location: IAvkluRmyxpOticFnjXFXweKTFDSJYBktlLkFHRbTFwCuqvqCz
Distribution: IAvkluRmyxpOticFnjXFXweKTFDSJYBktlLkFHRbTFwCuqvqCz
Posts: 3

Original Poster
Rep: Reputation: 0
Thumbs up [solved]

thank you very much keith hedger, I understood something more about makefiles, and the idea to use "DESTDIR" was great, it worked perfectly at first attempt!!

I think that thread can be closed because, alredy solved.

jena_arch
 
  


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
5.16 Coreutils-6.12 jpeters Linux From Scratch 1 03-29-2009 03:23 PM
6.16. Coreutils-6.9 errors... rcg1984 Linux From Scratch 2 08-17-2008 01:23 PM
kernel recompilation sachin_malik Linux - Enterprise 1 05-20-2005 01:57 PM
Recompilation of the kernel s_shenbaga Linux - Newbie 2 04-14-2005 03:06 PM
recompilation cybercop12us Linux - General 1 08-22-2001 04:11 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 10:18 AM.

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