Subject: sunpro and -xarch=v9 on Solaris 10
To: None <tech-pkg@NetBSD.org>
From: Steven Gurr <Steven.Gurr@Sun.COM>
List: tech-pkg
Date: 12/04/2005 18:48:29
I've recently installed the Sun Studio 11 packages from Sun, and  
tried to start building packages with it. In my mk.conf I have this:

PKGSRC_COMPILER=sunpro
CFLAGS+=-xarch=v9
LDFLAGS+=-xarch=v9
CC=/opt/SUNWspro/bin/cc
CXX=/opt/SUNWspro/bin/CC


Most things seem to have worked, but some packages don't build  
properly as it makes all the .o files with the -xarch=v9, but then  
tries to link them without the -xarch=v9 flag. This ends up giving an  
error. Below is an example of it, taken from databases/db4.

CC -G -nolib -hlibdb4_cxx-4.3.so -o .libs/libdb4_cxx-4.3.so   .libs/ 
cxx_db.o .libs/cxx_dbc.o .libs/cxx_dbt.o .libs/cxx_env.o .libs/ 
cxx_except.o .libs/cxx_lock.o .libs/cxx_logc.o .libs/ 
cxx_mpool.o .libs/cxx_multi.o .libs/cxx_seq.o .libs/cxx_txn.o .libs/ 
db185.o .libs/mut_pthread.o .libs/bt_compare.o .libs/bt_conv.o .libs/ 
bt_curadj.o .libs/bt_cursor.o .libs/bt_delete.o .libs/ 
bt_method.o .libs/bt_open.o .libs/bt_put.o .libs/bt_rec.o .libs/ 
bt_reclaim.o .libs/bt_recno.o .libs/bt_rsearch.o .libs/ 
bt_search.o .libs/bt_split.o .libs/bt_stat.o .libs/bt_upgrade.o .libs/ 
btree_auto.o .libs/hash.o .libs/hash_auto.o .libs/hash_conv.o .libs/ 
hash_dup.o .libs/hash_meta.o .libs/hash_method.o .libs/ 
hash_open.o .libs/hash_page.o .libs/hash_rec.o .libs/ 
hash_reclaim.o .libs/hash_stat.o .libs/hash_upgrade.o .libs/ 
hash_verify.o .libs/qam.o .libs/qam_auto.o .libs/qam_conv.o .libs/ 
qam_files.o .libs/qam_method.o .libs/qam_open.o .libs/qam_rec.o .libs/ 
qam_stat.o .libs/qam_upgrade.o .libs/qam_verify.o .libs/ 
rep_auto.o .libs/rep_backup.o .libs/rep_method.o .libs/ 
rep_record.o .libs/rep_region.o .libs/rep_stat.o .libs/ 
rep_util.o .libs/db_ovfl_vrfy.o .libs/db_vrfy.o .libs/ 
db_vrfyutil.o .libs/bt_verify.o .libs/aes_method.o .libs/ 
crypto.o .libs/mt19937db.o .libs/rijndael-alg-fst.o .libs/rijndael- 
api-fst.o .libs/client.o .libs/db_server_clnt.o .libs/ 
db_server_xdr.o .libs/gen_client.o .libs/gen_client_ret.o .libs/ 
crdel_auto.o .libs/crdel_rec.o .libs/db.o .libs/db_am.o .libs/ 
db_auto.o .libs/db_byteorder.o .libs/db_cam.o .libs/db_conv.o .libs/ 
db_dispatch.o .libs/db_dup.o .libs/db_err.o .libs/db_getlong.o .libs/ 
db_idspace.o .libs/db_iface.o .libs/db_join.o .libs/db_log2.o .libs/ 
db_meta.o .libs/db_method.o .libs/db_open.o .libs/db_overflow.o .libs/ 
db_pr.o .libs/db_rec.o .libs/db_reclaim.o .libs/db_rename.o .libs/ 
db_remove.o .libs/db_ret.o .libs/db_salloc.o .libs/db_setid.o .libs/ 
db_setlsn.o .libs/db_shash.o .libs/db_stati.o .libs/ 
db_truncate.o .libs/db_upg.o .libs/db_upg_opd.o .libs/dbm.o .libs/ 
dbreg.o .libs/dbreg_auto.o .libs/dbreg_rec.o .libs/dbreg_stat.o .libs/ 
dbreg_util.o .libs/env_file.o .libs/env_method.o .libs/ 
env_open.o .libs/env_recover.o .libs/env_region.o .libs/ 
env_stat.o .libs/fileops_auto.o .libs/fop_basic.o .libs/ 
fop_rec.o .libs/fop_util.o .libs/hash_func.o .libs/hmac.o .libs/ 
hsearch.o .libs/lock.o .libs/lock_deadlock.o .libs/lock_id.o .libs/ 
lock_list.o .libs/lock_method.o .libs/lock_region.o .libs/ 
lock_stat.o .libs/lock_timer.o .libs/lock_util.o .libs/log.o .libs/ 
log_archive.o .libs/log_compare.o .libs/log_get.o .libs/ 
log_method.o .libs/log_put.o .libs/log_stat.o .libs/mp_alloc.o .libs/ 
mp_bh.o .libs/mp_fget.o .libs/mp_fmethod.o .libs/mp_fopen.o .libs/ 
mp_fput.o .libs/mp_fset.o .libs/mp_method.o .libs/mp_region.o .libs/ 
mp_register.o .libs/mp_stat.o .libs/mp_sync.o .libs/ 
mp_trickle.o .libs/mutex.o .libs/os_abs.o .libs/os_alloc.o .libs/ 
os_clock.o .libs/os_config.o .libs/os_dir.o .libs/os_errno.o .libs/ 
os_fid.o .libs/os_fsync.o .libs/os_handle.o .libs/os_id.o .libs/ 
os_map.o .libs/os_method.o .libs/os_oflags.o .libs/os_open.o .libs/ 
os_region.o .libs/os_rename.o .libs/os_root.o .libs/os_rpath.o .libs/ 
os_rw.o .libs/os_seek.o .libs/os_sleep.o .libs/os_spin.o .libs/ 
os_stat.o .libs/os_tmpdir.o .libs/os_truncate.o .libs/ 
os_unlink.o .libs/sha1.o .libs/seq_stat.o .libs/sequence.o .libs/ 
snprintf.o .libs/txn.o .libs/txn_auto.o .libs/txn_method.o .libs/ 
txn_rec.o .libs/txn_recover.o .libs/txn_region.o .libs/ 
txn_stat.o .libs/txn_util.o .libs/xa.o .libs/xa_db.o .libs/xa_map.o  - 
L/usr/pkgsrc/databases/db4/work/.buildlink/lib   -Qoption ld -R/usr/ 
pkg/lib
ld: fatal: file .libs/cxx_db.o: wrong ELF class: ELFCLASS64
ld: fatal: File processing errors. No output written to .libs/ 
libdb4_cxx-4.3.so

Can anyone suggest why some of the compiling/linking lines include  
the -xarch=v9 flag, but not all?

Thanks
Steven