Open GoogleCodeExporter opened 9 years ago
Doing some more digging. One problem could be concurrency, the "ar" line might
not correspond to the error message. I isolated the command that results in the
error:
maciej@unstable10x [unstable10x]:~/src/opencsw/pkg/leveldb/trunk $ (cd
/home/maciej/src/opencsw/pkg/leveldb/trunk/work/solaris10-i386/build-isa-amd64/l
eveldb-1.4.0; /opt/csw/bin/g++-4.6 -m64 -march=opteron -L/opt/csw/gxx/lib/64
-L/opt/csw/lib/64 -lpthread -lrt -shared -Wl,-soname
-Wl,/home/maciej/src/opencsw/pkg/leveldb/trunk/work/solaris10-i386/build-isa-amd
64/leveldb-1.4.0/libleveldb.so.1 -O2 -pipe -m64 -march=opteron -I. -I./include
-fno-builtin-memcmp -D_REENTRANT -DOS_SOLARIS -DLEVELDB_PLATFORM_POSIX -O2
-DNDEBUG -fPIC db/builder.cc db/c.cc db/db_impl.cc db/db_iter.cc
db/dbformat.cc db/filename.cc db/log_reader.cc db/log_writer.cc db/memtable.cc
db/repair.cc db/table_cache.cc db/version_edit.cc db/version_set.cc
db/write_batch.cc table/block.cc table/block_builder.cc table/filter_block.cc
table/format.cc table/iterator.cc table/merger.cc table/table.cc
table/table_builder.cc table/two_level_iterator.cc util/arena.cc util/bloom.cc
util/cache.cc util/coding.cc util/comparator.cc util/crc32c.cc util/env.cc
util/env_posix.cc util/filter_policy.cc util/hash.cc util/histogram.cc
util/logging.cc util/options.cc util/status.cc port/port_posix.cc -o
libleveldb.so.1.4)
ld: warning: option -o appears more than once, first setting taken
ld: fatal: file
/home/maciej/src/opencsw/pkg/leveldb/trunk/work/solaris10-i386/build-isa-amd64/l
eveldb-1.4.0/libleveldb.so.1: open failed: No such file or directory
ld: fatal: File processing errors. No output written to libleveldb.so.1.4
maciej@unstable10x [unstable10x]:~/src/opencsw/pkg/leveldb/trunk $ ls -l
/home/maciej/src/opencsw/pkg/leveldb/trunk/work/solaris10-i386/build-isa-amd64/l
eveldb-1.4.0
total 756
-rw-r--r-- 1 maciej csw 193 Apr 30 22:31 AUTHORS
-rw-r--r-- 1 maciej csw 1484 Apr 30 22:31 LICENSE
-rw-r--r-- 1 maciej csw 6992 Apr 30 22:31 Makefile
-rw-r--r-- 1 maciej csw 509 Apr 30 22:31 NEWS
-rw-r--r-- 1 maciej csw 1713 Apr 30 22:31 README
-rw-r--r-- 1 maciej csw 494 Apr 30 22:31 TODO
-rw-r--r-- 1 maciej csw 1012 May 8 20:26 build_config.mk
-rwxr-xr-x 1 maciej csw 5203 Apr 30 22:31 build_detect_platform
drwxr-xr-x 2 maciej csw 56 May 8 20:10 db
drwxr-xr-x 3 maciej csw 9 Apr 30 22:31 doc
drwxr-xr-x 3 maciej csw 3 Apr 30 22:31 helpers
drwxr-xr-x 3 maciej csw 3 Apr 30 22:31 include
-rw-r--r-- 1 maciej csw 771778 May 8 20:10 libleveldb.a
drwxr-xr-x 3 maciej csw 12 May 8 20:10 port
drwxr-xr-x 2 maciej csw 29 May 8 20:10 table
drwxr-xr-x 2 maciej csw 49 May 8 20:10 util
Another thing is that soname looks wrong; it shouldn't contain a full path. Yet
another thing is the linker; GCC on Solaris uses the Solaris linker, which
accepts different flags than the GNU linker. For instance, it needs "-h
foo.so.1" to set the soname.
Here's a working invocation, which produces a shared library:
maciej@unstable10x [unstable10x]:~/src/opencsw/pkg/leveldb/trunk $ (cd
/home/maciej/src/opencsw/pkg/leveldb/trunk/work/solaris10-i386/build-isa-amd64/l
eveldb-1.4.0; /opt/csw/bin/g++-4.6 -m64 -march=opteron -L/opt/csw/gxx/lib/64
-L/opt/csw/lib/64 -lpthread -lrt -shared -Wl,-h -Wl,libleveldb.so.1 -O2 -pipe
-m64 -march=opteron -I. -I./include -fno-builtin-memcmp -D_REENTRANT
-DOS_SOLARIS -DLEVELDB_PLATFORM_POSIX -O2 -DNDEBUG -fPIC db/builder.cc
db/c.cc db/db_impl.cc db/db_iter.cc db/dbformat.cc db/filename.cc
db/log_reader.cc db/log_writer.cc db/memtable.cc db/repair.cc db/table_cache.cc
db/version_edit.cc db/version_set.cc db/write_batch.cc table/block.cc
table/block_builder.cc table/filter_block.cc table/format.cc table/iterator.cc
table/merger.cc table/table.cc table/table_builder.cc
table/two_level_iterator.cc util/arena.cc util/bloom.cc util/cache.cc
util/coding.cc util/comparator.cc util/crc32c.cc util/env.cc util/env_posix.cc
util/filter_policy.cc util/hash.cc util/histogram.cc util/logging.cc
util/options.cc util/status.cc port/port_posix.cc -o libleveldb.so.1.4)
What would be the best way to modify the build scripts to support Solaris
builds?
Original comment by blizin...@google.com
on 8 May 2012 at 6:35
Original issue reported on code.google.com by
blizin...@google.com
on 8 May 2012 at 6:21