I'm trying to build libgccjit on Illumos according to the instructions and
am running into a few build/link errors.  Some of them appear to be because
of missing the following two linker flags: -lxnet and -lsocket.  I tried
running configure with LIBS="-lsocket -lxnet" prepended but it didn't
help.  Here is the output of one failing step:

neal@openindiana:~/gccjitbuild/gcc$ g++ -no-pie   -g -O2     -DIN_GCC
 -fno-exceptions -fno-rtti -fasynchronous-unwind-tables -W -Wall
-Wno-error=narrowing -Wwrite-strings -Wcast-qual -Wmissing-format-attribute
-Wconditionally-supported -Woverloaded-virtual -pedantic -Wno-long-long
-Wno-variadic-macros -Wno-overlength-strings  -DHAVE_CONFIG_H -no-pie
-static-libstdc++ -static-libgcc  -o cc1plus \
      cp/cp-lang.o c-family/stub-objc.o cp/call.o cp/class.o cp/constexpr.o
cp/constraint.o cp/coroutines.o cp/cp-gimplify.o cp/cp-objcp-common.o
cp/cp-ubsan.o cp/cvt.o cp/contracts.o cp/cxx-pretty-print.o cp/decl.o
cp/decl2.o cp/dump.o cp/error.o cp/except.o cp/expr.o cp/friend.o cp/init.o
cp/lambda.o cp/lex.o cp/logic.o cp/mangle.o cp/mapper-client.o
cp/mapper-resolver.o cp/method.o cp/module.o cp/name-lookup.o cp/optimize.o
cp/parser.o cp/pt.o cp/ptree.o cp/rtti.o cp/search.o cp/semantics.o
cp/tree.o cp/typeck.o cp/typeck2.o cp/vtable-class-hierarchy.o attribs.o
c-family/c-common.o c-family/c-cppbuiltin.o c-family/c-dump.o
c-family/c-format.o c-family/c-gimplify.o c-family/c-indentation.o
c-family/c-lex.o c-family/c-omp.o c-family/c-opts.o c-family/c-pch.o
c-family/c-ppoutput.o c-family/c-pragma.o c-family/c-pretty-print.o
c-family/c-semantics.o c-family/c-ada-spec.o c-family/c-ubsan.o
c-family/known-headers.o c-family/c-attribs.o c-family/c-warn.o
c-family/c-spellcheck.o c-family/c-type-mismatch.o i386-c.o sol2-c.o
sol2-cxx.o default-c.o cc1plus-checksum.o simple-diagnostic-path.o
lazy-diagnostic-path.o libbackend.a main.o libcommon-target.a libcommon.a
../libcpp/libcpp.a ../libdecnumber/libdecnumber.a ../libcody/libcody.a \
libcommon.a ../libcpp/libcpp.a   ../libbacktrace/.libs/libbacktrace.a
../libiberty/pic/libiberty.a ../libdecnumber/libdecnumber.a   -lmpc -lmpfr
-lgmp   -L./../zlib -lz -lzstd
> >

Undefined first referenced
 symbol      in file
__xnet_connect                      ../libcody/libcody.a(netclient.o)
__xnet_socket                       ../libcody/libcody.a(netclient.o)
__xnet_getaddrinfo                  ../libcody/libcody.a(netclient.o)
freeaddrinfo                        ../libcody/libcody.a(netclient.o)
gai_strerror                        ../libcody/libcody.a(netclient.o)
ld: fatal: symbol referencing errors. No output written to cc1plus
collect2: error: ld returned 1 exit status

I'm happy to submit a patch but I'm not sure where to start - does
configure.ac need a check to see if -lxnet and -lsocket are necessary to
link?

I'm able to work past this by manually running the above command after
editing it to include the -lxnet flag, but then I run into an error I'm
less sure of how to debug:

/export/home/neal/gccjitbuild/./gcc/xgcc
-B/export/home/neal/gccjitbuild/./gcc/
-B/export/home/neal/gccjitinstall/x86_64-pc-solaris2.11/bin/
-B/export/home/neal/gccjitinstall/x86_64-pc-solaris2.11/lib/ -isystem
/export/home/neal/gccjitinstall/x86_64-pc-solaris2.11/include -isystem
/export/home/neal/gccjitinstall/x86_64-pc-solaris2.11/sys-include    -g -O2
-O2  -g -O2 -DIN_GCC   -W -Wall -Wno-error=narrowing -Wwrite-strings
-Wcast-qual -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition
 -isystem ./include  -fpic -g -DIN_LIBGCC2 -fbuilding-libgcc
-fno-stack-protector  -fpic -I. -I. -I../.././gcc -I../../../gcc/libgcc
-I../../../gcc/libgcc/. -I../../../gcc/libgcc/../gcc
-I../../../gcc/libgcc/../include  -DHAVE_CC_TLS   -o
_gcov_indirect_call_profiler_v4.o -MT _gcov_indirect_call_profiler_v4.o -MD
-MP -MF _gcov_indirect_call_profiler_v4.dep
-DL_gcov_indirect_call_profiler_v4 -c ../../../gcc/libgcc/libgcov-profiler.c
Assembler: libgcov-profiler.c
"/var/tmp//ccRhaWk5.s", line 36 : Syntax error
Near line: " data16 leaq __gcov_indirect_call@tlsgd(%rip), %rdi"
"/var/tmp//ccRhaWk5.s", line 48 : Syntax error
Near line: " data16 leaq __gcov_indirect_call@tlsgd(%rip), %rdi"
"/var/tmp//ccRhaWk5.s", line 497 : Syntax error
Near line: " data16 leaq __gcov_indirect_call@tlsgd(%rip), %rdi"
"/var/tmp//ccRhaWk5.s", line 509 : Syntax error
Near line: " data16 leaq __gcov_indirect_call@tlsgd(%rip), %rdi"
gmake[2]: *** [Makefile:937: _gcov_indirect_call_profiler_v4.o] Error 1
gmake[2]: Leaving directory
'/export/home/neal/gccjitbuild/x86_64-pc-solaris2.11/libgcc'
gmake[1]: *** [Makefile:14682: all-target-libgcc] Error 2
gmake[1]: Leaving directory '/export/home/neal/gccjitbuild'
gmake: *** [Makefile:1064: all] Error 2
neal@openindiana:~/gccjitbuild$

Thanks in advance for any assistance,

Neal

Reply via email to