Re: [Gc] "include/private/gcconfig.h", line 604: #error: "The collector has not been ported to this machine/OS combination."

Dennis Clarke <[email protected]> Tue, 22 Nov 2016 12:39:49 -0500
Newsgroups gmane.comp.programming.garbage-collection.boehmgc
Message-ID <[email protected]>
On 11/22/2016 06:52 AM, Bruce Hoult wrote:
> To amplify some more .. the only thing that "The collector has not been
> ported to this machine/OS combination." means is that no one tried it
> with your particular combination of machine/compiler. If your machine is
> similar to others that work -- or if it works with other compilers --
> then the chances are good that the problem is simply that your compiler
> isn't defining the preprocessor macros the header files are looking for.
>
> You can find what preprocessor macros are defined with:
>
> gcc -dM -E - </dev/null
>
> Well, that works for gcc, g++, clang, clang++.
>
> I'm not familiar with your compiler, but it appears that you're using
> the -Xc flag and according to this page ...
>
> https://docs.oracle.com/cd/E19205-01/819-5265/6n7c29df6/index.html
>
> .. when -Xc is used none of "sun", "sparc" or "unix" are defined. So you
> might try adding tests for "__sun", "__sparc" and "__unix" to the tests.
>
> e.g.
>
> # if (defined(sun) || defined(__sun)) && (defined(sparc) ||
> defined(__sparc))
> #   define SPARC
>     /* Test for SunOS 5.x */
> #     include <errno.h>
> #     define SOLARIS
> #   define mach_type_known
> # endif
>
> This might or might not be enough to make everything work properly, but
> at least it means the build system will now try to compile the code.
>

Thank you for the reply because I was flailing a bit here trying to
figure out what the issue was.  Seems to be libatomic_ops is broken
somewhere.

     I found the world is a lot easier to deal with by just letting go
of the reins a small bit :-) so I stopped trying with the c99 compiler
which is obscenely strict and switched over to just cc.  That works.

                     Sort of.

The whole process seems to work fine past configure and into the
compile right up until we need to deal with :

libtool:   error: 'libatomic_ops/src/atomic_ops_sysdeps.lo' is not a 
valid libtool object

Weird error.

There appears to be a strange assembly language source file in
the libatomic_ops area called libatomic_ops/src/atomic_ops_sysdeps.S
however there isn't much in it :

mimas$ cat libatomic_ops/src/atomic_ops_sysdeps.S
/*
  * Include the appropriate system-dependent assembly file, if any.
  * This is used only if the platform supports neither inline assembly
  * code, nor appropriate compiler intrinsics.
  */

#if !defined(__GNUC__) && (defined(sparc) || defined(__sparc))
#  include 
"atomic_ops/sylibatomic_ops/src/atomic_ops_sysdeps.sdeps/sunc/sparc.S"
#endif


Well that is strange because assembly can be compiled no problem.

I look and see that something was done for sure :

mimas$ ls -lap .libs/atomic_ops_sysdeps.o
-rw-r--r--   1 dclarke  devl         656 Nov 21 14:47 
.libs/atomic_ops_sysdeps.o

mimas$ ls -lap  atomic_ops_sysdeps.o
-rw-r--r--   1 dclarke  devl         656 Nov 21 14:47 atomic_ops_sysdeps.o


So evil libtool comes along later and seems to go looking for 
libatomic_ops/src/atomic_ops_sysdeps.lo which does not exist at all and 
the whole process comes to a halt.

In fact the entire build process related to that file looks like :


Step 1 :

/usr/local/bin/bash ./libtool  --tag=CC   --mode=compile 
/opt/solarisstudio12.4/bin/cc -DHAVE_CONFIG_H   -I./include -I./include 
-I./libatomic_ops/src -I./libatomic_ops/src -D_TS_ERRNO 
-D_POSIX_PTHREAD_SEMANTICS -D_LARGEFILE64_SOURCE   -m64 -xtarget=ultra2 
-xarch=sparcvis -xchip=ultra2 -xcache=generic -errwarn=%none 
-errhdr=%user -erroff=%none -errtags=yes -errfmt=error -errshort=full 
-xstrconst -xildoff -xmemalign=8s -xnolibmil -Xa -xcode=pic32 
-xregs=no%appl -xlibmieee -mc -g -xs -ftrap=%none -Qy -xbuiltin=%none 
-xdebugformat=dwarf -xunroll=1 -D_TS_ERRNO -D_POSIX_PTHREAD_SEMANTICS 
-D_LARGEFILE64_SOURCE  -c libatomic_ops/src/atomic_ops_sysdeps.S


Step 2 :

libtool: compile:  /opt/solarisstudio12.4/bin/cc -DHAVE_CONFIG_H 
-I./include -I./include -I./libatomic_ops/src -I./libatomic_ops/src 
-D_TS_ERRNO -D_POSIX_PTHREAD_SEMANTICS -D_LARGEFILE64_SOURCE -m64 
-xtarget=ultra2 -xarch=sparcvis -xchip=ultra2 -xcache=generic 
-errwarn=%none -errhdr=%user -erroff=%none -errtags=yes -errfmt=error 
-errshort=full -xstrconst -xildoff -xmemalign=8s -xnolibmil -Xa 
-xcode=pic32 -xregs=no%appl -xlibmieee -mc -g -xs -ftrap=%none -Qy 
-xbuiltin=%none -xdebugformat=dwarf -xunroll=1 -D_TS_ERRNO 
-D_POSIX_PTHREAD_SEMANTICS -D_LARGEFILE64_SOURCE -c 
libatomic_ops/src/atomic_ops_sysdeps.S  -KPIC -DPIC -o 
.libs/atomic_ops_sysdeps.o


Step 3 :

libtool: compile:  /opt/solarisstudio12.4/bin/cc -DHAVE_CONFIG_H 
-I./include -I./include -I./libatomic_ops/src -I./libatomic_ops/src 
-D_TS_ERRNO -D_POSIX_PTHREAD_SEMANTICS -D_LARGEFILE64_SOURCE -m64 
-xtarget=ultra2 -xarch=sparcvis -xchip=ultra2 -xcache=generic 
-errwarn=%none -errhdr=%user -erroff=%none -errtags=yes -errfmt=error 
-errshort=full -xstrconst -xildoff -xmemalign=8s -xnolibmil -Xa 
-xcode=pic32 -xregs=no%appl -xlibmieee -mc -g -xs -ftrap=%none -Qy 
-xbuiltin=%none -xdebugformat=dwarf -xunroll=1 -D_TS_ERRNO 
-D_POSIX_PTHREAD_SEMANTICS -D_LARGEFILE64_SOURCE -c 
libatomic_ops/src/atomic_ops_sysdeps.S -o atomic_ops_sysdeps.o 
 >/dev/null 2>&1


Step 4 :

/usr/local/bin/bash ./libtool  --tag=CC   --mode=link 
/opt/solarisstudio12.4/bin/cc   -m64 -xtarget=ultra2 -xarch=sparcvis 
-xchip=ultra2 -xcache=generic -errwarn=%none -errhdr=%user -erroff=%none 
-errtags=yes -errfmt=error -errshort=full -xstrconst -xildoff 
-xmemalign=8s -xnolibmil -Xa -xcode=pic32 -xregs=no%appl -xlibmieee -mc 
-g -xs -ftrap=%none -Qy -xbuiltin=%none -xdebugformat=dwarf -xunroll=1 
-D_TS_ERRNO -D_POSIX_PTHREAD_SEMANTICS -D_LARGEFILE64_SOURCE 
-version-info 1:3:0 -no-undefined -L/usr/local/lib -o libgc.la -rpath 
/usr/local/lib allchblk.lo alloc.lo blacklst.lo checksums.lo dbg_mlc.lo 
dyn_load.lo finalize.lo gc_dlopen.lo gcj_mlc.lo headers.lo mach_dep.lo 
malloc.lo mallocx.lo mark.lo mark_rts.lo misc.lo new_hblk.lo obj_map.lo 
os_dep.lo pcr_interface.lo ptr_chck.lo real_malloc.lo reclaim.lo 
specific.lo stubborn.lo thread_local_alloc.lo typd_mlc.lo 
pthread_start.lo pthread_support.lo  pthread_stop_world.lo  fnlz_mlc.lo 
libatomic_ops/src/atomic_ops_sysdeps.lo sparc_mach_dep.lo 
-L/usr/lib/lwp/                       -R/usr/lib/lwp/ -lpthread -lrt -ldl
libtool:   error: 'libatomic_ops/src/atomic_ops_sysdeps.lo' is not a 
valid libtool object


So this is quite strange. The absence of the weird ".lo" file which only 
libtool needs.

Something went sadly wrong with libatomic_ops :

mimas$ cd libatomic_ops/src/

mimas$ ls -lo atomic_op*
-rw-r--r--   1 dclarke     7446 May 24  2016 atomic_ops.c
-rw-r--r--   1 dclarke    18806 May 24  2016 atomic_ops.h
-rw-r--r--   1 dclarke     8063 May 24  2016 atomic_ops_malloc.c
-rw-r--r--   1 dclarke     1665 May 24  2016 atomic_ops_malloc.h
-rw-r--r--   1 dclarke     9869 May 24  2016 atomic_ops_stack.c
-rw-r--r--   1 dclarke     6606 May 24  2016 atomic_ops_stack.h
-rw-r--r--   1 dclarke      306 May 24  2016 atomic_ops_sysdeps.S

atomic_ops:
total 150
-rw-r--r--   1 dclarke     1854 May 24  2016 ao_version.h
-rw-r--r--   1 dclarke   127867 May 24  2016 generalize-arithm.h
-rw-r--r--   1 dclarke    32899 May 24  2016 generalize-arithm.template
-rw-r--r--   1 dclarke   102089 May 24  2016 generalize-small.h
-rw-r--r--   1 dclarke    20649 May 24  2016 generalize-small.template
-rw-r--r--   1 dclarke    27996 May 24  2016 generalize.h
drwxr-xr-x  10 dclarke       25 May 24  2016 sysdeps


No object files seen there at all and that means 
libatomic_ops/src/atomic_ops_sysdeps.lo is missing and so is the object 
file.  However it does exist as :

mimas$ find . | grep "atomic_ops_sysdeps"
./.libs/atomic_ops_sysdeps.o
./atomic_ops_sysdeps.o
./libatomic_ops-7.4.4/src/.deps/atomic_ops_sysdeps.Plo
./libatomic_ops-7.4.4/src/atomic_ops_sysdeps.S
./atomic_ops_sysdeps.lo

The problem is somewhere down inside the libatomic sources.

I wrote a simple link hack.sh thus and ran it :

mimas$ cat hack.sh
#!/bin/ksh
/opt/solarisstudio12.4/bin/cc -\# -H \
-m64 -xtarget=ultra2 -xarch=sparcvis \
-xchip=ultra2 -xcache=generic -errwarn=%none -errhdr=%user \
-erroff=%none -errtags=yes -errfmt=error -errshort=full -xstrconst \
-xildoff -xmemalign=8s -xnolibmil -Xa -xcode=pic32 -xregs=no%appl \
-xlibmieee -mc -g -xs -ftrap=%none -Qy -xbuiltin=%none \
-xdebugformat=dwarf -xunroll=1 \
-D_TS_ERRNO -D_POSIX_PTHREAD_SEMANTICS -D_LARGEFILE64_SOURCE \
-L/usr/local/lib -L/usr/lib/lwp -R/usr/lib/lwp \
\
allchblk.o alloc.o blacklst.o checksums.o dbg_mlc.o dyn_load.o \
finalize.o gc_dlopen.o gcj_mlc.o headers.o mach_dep.o malloc.o \
mallocx.o mark.o mark_rts.o misc.o new_hblk.o obj_map.o os_dep.o \
pcr_interface.o ptr_chck.o real_malloc.o reclaim.o specific.o \
stubborn.o thread_local_alloc.o typd_mlc.o pthread_start.o \
pthread_support.o pthread_stop_world.o fnlz_mlc.o \
\
atomic_ops_sysdeps.o \
\
sparc_mach_dep.o \
\
-o libgc.foo -lpthread -lrt -ldl


Which works ( other than undefined symbols that must exist somewhere ) :


mimas$ ./hack.sh
### cc: Note: NLSPATH = 
/opt/solarisstudio12.4/bin/../lib/locale/%L/LC_MESSAGES/%N.cat:/opt/solarisstudio12.4/bin/../../lib/locale/%L/LC_MESSAGES/%N.cat
###     command line files and options (expanded):
### -# -H -m64 -xarch=sparcvis -xchip=ultra2 -xcache=generic 
-errwarn=%none -errhdr=%user -erroff=%none -errtags=yes -errfmt=error 
-errshort=full -xstrconst -xmemalign=8s -xnolibmil -Xa -xcode=pic32 
-xregs=no%appl -xlibmieee -mc 
-xdebuginfo=line,param,variable,tagtype,codetag,decl -xglobalize=yes 
-xpatchpadding=fix -xkeep_unref=funcs,vars -xs=yes -ftrap=%none -Qy 
-xbuiltin=%none -xdebugformat=dwarf -xunroll=1 -D_TS_ERRNO 
-D_POSIX_PTHREAD_SEMANTICS -D_LARGEFILE64_SOURCE -L/usr/local/lib 
-L/usr/lib/lwp -R/usr/lib/lwp allchblk.o alloc.o blacklst.o checksums.o 
dbg_mlc.o dyn_load.o finalize.o gc_dlopen.o gcj_mlc.o headers.o 
mach_dep.o malloc.o mallocx.o mark.o mark_rts.o misc.o new_hblk.o 
obj_map.o os_dep.o pcr_interface.o ptr_chck.o real_malloc.o reclaim.o 
specific.o stubborn.o thread_local_alloc.o typd_mlc.o pthread_start.o 
pthread_support.o pthread_stop_world.o fnlz_mlc.o atomic_ops_sysdeps.o 
sparc_mach_dep.o -olibgc.foo -lpthread -lrt -ldl
### cc: Note: LD_LIBRARY_PATH = (null)
### cc: Note: LD_LIBRARY_PATH_64 = (null)
### cc: Note: LD_RUN_PATH     = /usr/local/lib
### cc: Note: LD_OPTIONS      = -64 -L/usr/local/lib -R/usr/local/lib
ln -s /opt/solarisstudio12.4/lib/compilers /tmp/lib_link.1479836266.19734.01
/usr/ccs/bin/ld 
-zld32=-S/tmp/lib_link.1479836266.19734.01/libldstab_ws.so 
-zld64=-S/tmp/lib_link.1479836266.19734.01/sparcv9/libldstab_ws.so 
-zld32=-S/tmp/lib_link.1479836266.19734.01/libld_annotate.so 
-zld64=-S/tmp/lib_link.1479836266.19734.01/sparcv9/libld_annotate.so 
/opt/solarisstudio12.4/lib/compilers/sparcv9/crti.o 
/opt/solarisstudio12.4/lib/compilers/sparcv9/crt1.o 
/opt/solarisstudio12.4/lib/compilers/sparcv9/values-xi.o 
-L/usr/local/lib -L/usr/lib/lwp allchblk.o alloc.o blacklst.o 
checksums.o dbg_mlc.o dyn_load.o finalize.o gc_dlopen.o gcj_mlc.o 
headers.o mach_dep.o malloc.o mallocx.o mark.o mark_rts.o misc.o 
new_hblk.o obj_map.o os_dep.o pcr_interface.o ptr_chck.o real_malloc.o 
reclaim.o specific.o stubborn.o thread_local_alloc.o typd_mlc.o 
pthread_start.o pthread_support.o pthread_stop_world.o fnlz_mlc.o 
atomic_ops_sysdeps.o sparc_mach_dep.o -lpthread -lrt -ldl -o libgc.foo 
-Y 
"P,/opt/solarisstudio12.4/lib/compilers/staticlib/sparcv9:/opt/solarisstudio12.4/lib/compilers/sparcvis/sparcv9:/opt/solarisstudio12.4/lib/compilers/sparcv9:/usr/ccs/lib/sparcv9:/lib/64:/usr/lib/64" 
-Qy -R/usr/lib/lwp -lc /opt/solarisstudio12.4/lib/compilers/sparcv9/crtn.o
Undefined                       first referenced
  symbol                             in file
main 
/opt/solarisstudio12.4/lib/compilers/sparcv9/crt1.o
AO_compare_double_and_swap_double_emulation allchblk.o
AO_fetch_compare_and_swap_emulation allchblk.o
AO_store_full_emulation             mark.o
ld: fatal: symbol referencing errors. No output written to libgc.foo
mimas$


So the problem seems to be in the libatomic_ops region.



Dennis