www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - no panic: redundant ld parameters on Linux

This does not need to be addressed right now, it is for information, 
mainly to Walter, I guess.

On Linux (tested on DMD .139 and Fedora Core 4), the parameters to ld 
linker contain some lines that seem (to me, at least) redundant.

If this is a surprise, then you might want to look at it, otherwise just 
forget it.

---

Upon compiling the following program (called libtest1.d):

import std.c.stdio;
void main()
{}

The linker receives the following arguments (split at space, for 
readability):

--eh-frame-hdr
-m
elf_i386
-dynamic-linker
/lib/ld-linux.so.2
-o
libtest1
/usr/lib/gcc/i386-redhat-linux/4.0.0/../../../crt1.o
/usr/lib/gcc/i386-redhat-linux/4.0.0/../../../crti.o
/usr/lib/gcc/i386-redhat-linux/4.0.0/crtbegin.o

-L/usr/lib/gcc/i386-redhat-linux/4.0.0
-L/usr/lib/gcc/i386-redhat-linux/4.0.0/../../..
libtest1.o
-lphobos
-lpthread
-lm

--as-needed
-lgcc_s
--no-as-needed
-lc
-lgcc



/usr/lib/gcc/i386-redhat-linux/4.0.0/crtend.o
/usr/lib/gcc/i386-redhat-linux/4.0.0/../../../crtn.o



redundant, and which I could remove, without changing the compilation 
results.
Nov 22 2005