www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - Linker error while building phobos on linux on a fresh system

reply Andrei Alexandrescu <SeeWebsiteForEmail erdani.org> writes:
Wonder what I'm doing wrong. I ran "git pull --ff-only origin master" in 
dmd, druntime, and phobos. Built dmd -> fine. Built druntime -> fine. 
Ran "make -f posix.mak" for phobos, got:

/usr/bin/ld: cannot find -lphobos2

Apparently the command line that causes the problem is:

../dmd/src/dmd -I../druntime/import  -w -m64 -fPIC -O -release -shared 
-debuglib= -defaultlib= 
-ofgenerated/linux/release/64/libphobos2.so.0.67.0 
-L-soname=libphobos2.so.0.67 ../druntime/lib/libdruntime-linux64so.a 
-L-ldl -Lgenerated/linux/release/64/libcurl_stub.so std/algorithm.d 
std/array.d std/ascii.d std/base64.d std/bigint.d std/bitmanip.d 
std/compiler.d std/complex.d std/concurrency.d std/conv.d std/cstream.d 
std/csv.d std/datetime.d std/demangle.d std/encoding.d std/exception.d 
std/file.d std/format.d std/functional.d std/getopt.d std/json.d 
std/math.d std/mathspecial.d std/mmfile.d std/numeric.d std/outbuffer.d 
std/parallelism.d std/path.d std/process.d std/random.d std/range.d 
std/regex.d std/signals.d std/socket.d std/socketstream.d std/stdint.d 
std/stdio.d std/stdiobase.d std/stream.d std/string.d std/syserror.d 
std/system.d std/traits.d std/typecons.d std/typetuple.d std/uni.d 
std/uri.d std/utf.d std/uuid.d std/variant.d std/xml.d std/zip.d 
std/zlib.d std/c/linux/linux.d std/c/linux/socket.d etc/c/curl.d 
etc/c/sqlite3.d etc/c/zlib.d std/c/fenv.d std/c/locale.d std/c/math.d 
std/c/process.d std/c/stdarg.d std/c/stddef.d std/c/stdio.d 
std/c/stdlib.d std/c/string.d std/c/time.d std/c/wcharh.d 
std/internal/digest/sha_SSSE3.d std/internal/math/biguintcore.d 
std/internal/math/biguintnoasm.d std/internal/math/biguintx86.d 
std/internal/math/gammafunction.d std/internal/math/errorfunction.d 
std/internal/cstring.d std/internal/processinit.d 
std/internal/unicode_tables.d std/internal/scopebuffer.d 
std/internal/unicode_comp.d std/internal/unicode_decomp.d 
std/internal/unicode_grapheme.d std/internal/unicode_norm.d 
std/net/isemail.d std/net/curl.d std/digest/digest.d std/digest/crc.d 
std/digest/md.d std/digest/ripemd.d std/digest/sha.d 
std/container/package.d std/container/array.d std/container/binaryheap.d 
std/container/dlist.d std/container/rbtree.d std/container/slist.d 
std/container/util.d generated/linux/release/64/etc/c/zlib/adler32.o 
generated/linux/release/64/etc/c/zlib/compress.o 
generated/linux/release/64/etc/c/zlib/crc32.o 
generated/linux/release/64/etc/c/zlib/deflate.o 
generated/linux/release/64/etc/c/zlib/gzclose.o 
generated/linux/release/64/etc/c/zlib/gzlib.o 
generated/linux/release/64/etc/c/zlib/gzread.o 
generated/linux/release/64/etc/c/zlib/gzwrite.o 
generated/linux/release/64/etc/c/zlib/infback.o 
generated/linux/release/64/etc/c/zlib/inffast.o 
generated/linux/release/64/etc/c/zlib/inflate.o 
generated/linux/release/64/etc/c/zlib/inftrees.o 
generated/linux/release/64/etc/c/zlib/trees.o 
generated/linux/release/64/etc/c/zlib/uncompr.o 
generated/linux/release/64/etc/c/zlib/zutil.o


Andrei
Aug 25 2014
parent reply Andrei Alexandrescu <SeeWebsiteForEmail erdani.org> writes:
On 8/25/14, 3:37 PM, Andrei Alexandrescu wrote:
 Wonder what I'm doing wrong. I ran "git pull --ff-only origin master" in
 dmd, druntime, and phobos. Built dmd -> fine. Built druntime -> fine.
 Ran "make -f posix.mak" for phobos, got:

 /usr/bin/ld: cannot find -lphobos2
Argh, I had an old ~/dmd.conf. I've mentioned this before: our build process should override all user options and only use its own artifacts. I sent a diff a while ago adding an empty dmd.conf to phobos/, but there was backlash about it that I find unjustified. Andrei
Aug 25 2014
parent reply "Dicebot" <public dicebot.lv> writes:
On Monday, 25 August 2014 at 22:46:37 UTC, Andrei Alexandrescu 
wrote:
 On 8/25/14, 3:37 PM, Andrei Alexandrescu wrote:
 Wonder what I'm doing wrong. I ran "git pull --ff-only origin 
 master" in
 dmd, druntime, and phobos. Built dmd -> fine. Built druntime 
 -> fine.
 Ran "make -f posix.mak" for phobos, got:

 /usr/bin/ld: cannot find -lphobos2
Argh, I had an old ~/dmd.conf. I've mentioned this before: our build process should override all user options and only use its own artifacts. I sent a diff a while ago adding an empty dmd.conf to phobos/, but there was backlash about it that I find unjustified. Andrei
It needs to be fixed on DMD side and not via Phobos workarounds in my opinion. For example, by ignoring -defaultlib flag if it can't be found and trying to link anyway.
Aug 25 2014
parent "Jonathan M Davis" <jmdavisProg gmx.com> writes:
On Monday, 25 August 2014 at 23:26:40 UTC, Dicebot wrote:
 On Monday, 25 August 2014 at 22:46:37 UTC, Andrei Alexandrescu 
 wrote:
 Argh, I had an old ~/dmd.conf. I've mentioned this before: our 
 build process should override all user options and only use 
 its own artifacts. I sent a diff a while ago adding an empty 
 dmd.conf to phobos/, but there was backlash about it that I 
 find unjustified.

 Andrei
It needs to be fixed on DMD side and not via Phobos workarounds in my opinion. For example, by ignoring -defaultlib flag if it can't be found and trying to link anyway.
Yeah, I'd expect the empty dmd.conf to be part of dmd and not Phobos, but I do agree that we need something like that. - Jonathan M Davis
Aug 25 2014