Linux - NewbieThis 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
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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
Distribution: Void, Linux From Scratch, Slackware64
Posts: 3,152
Rep:
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.
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>
Distribution: Void, Linux From Scratch, Slackware64
Posts: 3,152
Rep:
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?
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.