Build issues: "-static" builds resulting initdb problems - Mailing list pgsql-sql

From Metin Ozisik
Subject Build issues: "-static" builds resulting initdb problems
Date
Msg-id 003a01c549e4$1485eea0$3401a8c0@pengu
Whole thread Raw
Responses Re: Build issues: "-static" builds resulting initdb problems
List pgsql-sql
Version: 8.0.2
 
Platforms: Linux, Fedora Core 2, Suse 9.2, Mandrake 10.1
 
Build time parameter: CFLAGS="-static" ./configure
 
        results in a staticly linked binaries. (you are supposed to have static lib versions of readline, ncurses, etc, etc. of course)
 
However, conversion shared objects built in src/backend/utils/mb/conversion_procs still retain unresolved symbols, like: LocalToUtf, UtfToLocal, pg_ascii2mic, pg_mic2ascii (from src/backend/utils/mb/conv.c), as may be observed in:
 
       for i in utf8*.so; do echo $i.....; nm $i | grep " U "; done
 
 
During initdb time, (I think initdb calls postgres and postgres attempts to load them.., regardless, both binaries are static), postgres' attempt to load conversion_procs fails with:
 
    initdb --pgdata=/some/directory -L /some/dir/pgsql/share
    ....
    loading pg_descriptions... ok
    creating conversions ... FATAL: could not load library "../ascii_and_misc.so": ../../ascii_and_misc.so: undefined symbol: pg_mic2ascii
    child process exited with exit code 1
 
 
I think a dynamic version of postgres would have supplied the unresolved symbols in shared-object load time, hence that wouldn't be an issue.
 
It seems undefined symbols in lib/utf8_and_*.so conversion procs (the four symbols listed above, from conv.c) needs to be resolved in link-time, so a "-static" build can work.
 
Regards,
-metin
 
 
 

pgsql-sql by date:

Previous
From: "tuan"
Date:
Subject: Division in Postgre
Next
From: "Igor Kryltsov"
Date:
Subject: Re: Help to drop table