truedat101 / dlang-sv-community

A community repository for stuff related to #dlang Silicon Valley Meetup group
http://www.meetup.com/D-Lang-Silicon-Valley/
2 stars 1 forks source link

Figure out how to remove warnings when static linking with LDC2 #67

Open truedat101 opened 5 years ago

truedat101 commented 5 years ago

ldc2 emits a bunch of warnings when using --static flag during linking. Example:

Performing "debug" build using ldc2 for x86_64.
lamb-d 0.1.1: building configuration "application"...
openssl-1.1.0l/libcrypto.a(dso_dlfcn.o): In function `dlfcn_globallookup':
dso_dlfcn.c:(.text+0x11): warning: Using 'dlopen' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
/homeofpancakes/dev/tools/ldc2-1.7.0-linux-x86_64/bin/../lib/libphobos2-ldc.a(path.o): In function `_D3std4path11expandTildeFNbAyaZ18expandFromDatabaseFNbQBbZQBf':
std/path.d:(.text._D3std4path11expandTildeFNbAyaZ18expandFromDatabaseFNbQBbZQBf[_D3std4path11expandTildeFNbAyaZ18expandFromDatabaseFNbQBbZQBf]+0xf1): warning: Using 'getpwnam_r' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
openssl-1.1.0l/libcrypto.a(b_addr.o): In function `BIO_lookup':
b_addr.c:(.text+0xc9c): warning: Using 'getaddrinfo' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
/homeofpancakes/dev/tools/ldc2-1.7.0-linux-x86_64/bin/../lib/libphobos2-ldc.a(socket.o): In function `_D3std6socket12InternetHost__T7getHostVAyaa118_0a2020202020202020202020206175746f2078203d2068746f6e6c28706172616d293b0a2020202020202020202020206175746f206865203d20676574686f73746279616464722826782c20342c206361737428696e7429204164647265737346616d696c792e494e4554293b0a2020202020202020TkZQJwMFkZb':
std/socket.d:(.text._D3std6socket12InternetHost__T7getHostVAyaa118_0a2020202020202020202020206175746f2078203d2068746f6e6c28706172616d293b0a2020202020202020202020206175746f206865203d20676574686f73746279616464722826782c20342c206361737428696e7429204164647265737346616d696c792e494e4554293b0a2020202020202020TkZQJwMFkZb[_D3std6socket12InternetHost__T7getHostVAyaa118_0a2020202020202020202020206175746f2078203d2068746f6e6c28706172616d293b0a2020202020202020202020206175746f206865203d20676574686f73746279616464722826782c20342c206361737428696e7429204164647265737346616d696c792e494e4554293b0a2020202020202020TkZQJwMFkZb]+0x37): warning: Using 'gethostbyaddr' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
openssl-1.1.0l/libcrypto.a(b_sock.o): In function `BIO_gethostbyname':
b_sock.c:(.text+0x71): warning: Using 'gethostbyname' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
/homeofpancakes/dev/tools/ldc2-1.7.0-linux-x86_64/bin/../lib/libphobos2-ldc.a(socket.o): In function `_D3std6socket8Protocol17getProtocolByTypeMFNbNeEQBuQBt12ProtocolTypeZb':
std/socket.d:(.text._D3std6socket8Protocol17getProtocolByTypeMFNbNeEQBuQBt12ProtocolTypeZb[_D3std6socket8Protocol17getProtocolByTypeMFNbNeEQBuQBt12ProtocolTypeZb]+0x7): warning: Using 'getprotobynumber' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
/homeofpancakes/dev/tools/ldc2-1.7.0-linux-x86_64/bin/../lib/libphobos2-ldc.a(socket.o): In function `_D3std6socket8Protocol17getProtocolByNameMFNbNexAaZb':
std/socket.d:(.text._D3std6socket8Protocol17getProtocolByNameMFNbNexAaZb[_D3std6socket8Protocol17getProtocolByNameMFNbNexAaZb]+0x26): warning: Using 'getprotobyname' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
/homeofpancakes/dev/tools/ldc2-1.7.0-linux-x86_64/bin/../lib/libphobos2-ldc.a(socket.o): In function `_D3std6socket7Service16getServiceByNameMFNbNexAaxQdZb':
std/socket.d:(.text._D3std6socket7Service16getServiceByNameMFNbNexAaxQdZb[_D3std6socket7Service16getServiceByNameMFNbNexAaxQdZb]+0x5d): warning: Using 'getservbyname' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
/homeofpancakes/dev/tools/ldc2-1.7.0-linux-x86_64/bin/../lib/libphobos2-ldc.a(socket.o): In function `_D3std6socket7Service16getServiceByPortMFNbNetxAaZb':
std/socket.d:(.text._D3std6socket7Service16getServiceByPortMFNbNetxAaZb[_D3std6socket7Service16getServiceByPortMFNbNetxAaZb]+0x2a): warning: Using 'getservbyport' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking

This is horrible, ugly, concerning, and it doesn't feel right that this is just happening by default.

Task: track down the source of the problem, look into whether there are some means to suppress the the output

truedat101 commented 5 years ago

@jondegenhardt following up on this item we discussed at the meetup.