Bug 90645 - sparc-unknown-linux-gnu/libgo/.libs/libgo.so: undefined reference to `fdopendir'
Summary: sparc-unknown-linux-gnu/libgo/.libs/libgo.so: undefined reference to `fdopendir'
Status: RESOLVED WONTFIX
Alias: None
Product: gcc
Classification: Unclassified
Component: go (show other bugs)
Version: 9.1.0
: P3 normal
Target Milestone: ---
Assignee: Ian Lance Taylor
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-05-27 15:03 UTC by martin
Modified: 2019-05-30 18:09 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed:


Attachments
usr\include\bits (760 bytes, text/plain)
2019-05-27 15:07 UTC, martin
Details

Note You need to log in before you can comment on or make changes to this bug.
Description martin 2019-05-27 15:03:57 UTC
the exact version of GCC:
gcc-9.1.0

the system type:
NetgearReadyNAS Duo (http://wiki.dietpc.org/index.php/DIET-PC_on_SPARC_ReadyNAS)

the options given when GCC was configured/built:
../gcc-9.1.0/configure CC=/opt/gcc-7.1/bin/gcc CXX=/opt/gcc-7.1/bin/g++ --enable-languages=c,c++,go --prefix=/opt/gcc-9.1 --with-cpu=v7 --with-mpc=/usr/local --with-mpfr=/usr/local --with-gmp=/usr/local --with-isl=/usr/local/ --disable-libstdcxx-pch --disable-linux-futex --disable-libsanitizer --enable-__cxa_atexit --enable-nls --enable-clocale=gnu --enable-debug --disable-doc --disable-libcilkrts --disable-libitm


the complete command line that triggers the bug;
/usr/local/bin/make

the compiler output (error messages, warnings, etc.);
[...]
make[2]: Entering directory '/c/backup/fes-readynasduo/gcc-9.1.0-compiled/gotools'
/backup/fes-readynasduo/gcc-9.1.0-compiled/./gcc/gccgo -B/backup/fes-readynasduo/gcc-9.1.0-compiled/./gcc/ -B/opt/gcc-9.1/sparc-unknown-linux-gnu/bin/ -B/opt/gcc-9.1/sparc-unknown-linux-gnu/lib/ -isystem /opt/gcc-9.1/sparc-unknown-linux-gnu/include -isystem /opt/gcc-9.1/sparc-unknown-linux-gnu/sys-include   -g -O2 -I ../sparc-unknown-linux-gnu/libgo -static-libstdc++ -static-libgcc  -L ../sparc-unknown-linux-gnu/libgo -L ../sparc-unknown-linux-gnu/libgo/.libs -o go ../../gcc-9.1.0/gotools/../libgo/go/cmd/go/alldocs.go ../../gcc-9.1.0/gotools/../libgo/go/cmd/go/go11.go ../../gcc-9.1.0/gotools/../libgo/go/cmd/go/main.go ../sparc-unknown-linux-gnu/libgo/libgotool.a
../sparc-unknown-linux-gnu/libgo/.libs/libgo.so: undefined reference to `fdopendir'
../sparc-unknown-linux-gnu/libgo/.libs/libgo.so: undefined reference to `__sync_bool_compare_and_swap_4'
../sparc-unknown-linux-gnu/libgo/.libs/libgo.so: undefined reference to `__tls_get_addr'
../sparc-unknown-linux-gnu/libgo/.libs/libgo.so: undefined reference to `__go_openat'
../sparc-unknown-linux-gnu/libgo/.libs/libgo.so: undefined reference to `fstatat64'
collect2: error: ld returned 1 exit status
make[2]: *** [Makefile:821: go] Error 1
make[2]: Leaving directory '/c/backup/fes-readynasduo/gcc-9.1.0-compiled/gotools'
make[1]: *** [Makefile:15520: all-gotools] Error 2
make[1]: Leaving directory '/c/backup/fes-readynasduo/gcc-9.1.0-compiled'
make: *** [Makefile:993: all] Error 2

 ldd -r /backup/fes-readynasduo/gcc-9.1.0-compiled/gcc/gccgo                                                                                                          libiconv.so.2 => /usr/local/lib/libiconv.so.2 (0x2002c000)                                                                                                                          libm.so.6 => /lib/libm.so.6 (0x20124000)                                                                                                                                            libc.so.6 => /lib/libc.so.6 (0x201b8000)                                                                                                                                            /lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x20000000)

/backup/fes-readynasduo/gcc-9.1.0-compiled/gcc/gccgo --version                                                                                                    gccgo (GCC) 9.1.0                                                                                                                                                                   Copyright (C) 2019 Free Software Foundation, Inc.                                                                                                                                   This is free software; see the source for copying conditions.  There is NO                                                                                                          warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 

Not sure which information is important for this bug.
Comment 1 Andrew Pinski 2019-05-27 15:05:25 UTC
>fdopendir() is available in glibc since version 2.4.

What glibc version are you using?
Comment 2 martin 2019-05-27 15:07:23 UTC
Created attachment 46419 [details]
usr\include\bits

ldd --version                                                                                                                                                     ldd (GNU libc) 2.3.2                                                                                                                                                                Copyright (C) 2003 Free Software Foundation, Inc.                                                                                                                                   This is free software; see the source for copying conditions.  There is NO                                                                                                          warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.                                                                                                         Written by Roland McGrath and Ulrich Drepper.
Comment 3 Ian Lance Taylor 2019-05-27 19:23:44 UTC
Did libgo ever work on this system?  I can't remember.  I don't see how we can work around a missing __tls_get_addr symbol.  That suggests that the system does not support Thread Local Storage.
Comment 4 Eric Botcazou 2019-05-28 06:57:20 UTC
Your system is way too old to support Go.
Comment 5 martin 2019-05-30 07:19:52 UTC
Are there any chances to get gccgo build on this machine by the following options?
- crosscompiling
- update libc
Comment 6 Eric Botcazou 2019-05-30 07:43:02 UTC
> Are there any chances to get gccgo build on this machine by the following
> options?
> - crosscompiling
> - update libc

Cross-compiling doesn't really matter here if you ultimately need to run the Go programs on the machines.  You probably need to update the entire system.
Comment 7 Ian Lance Taylor 2019-05-30 17:05:27 UTC
Among the requirements for gccgo is support for Thread Local Storage.  If your system does not support that, gccgo cannot work.
Comment 8 martin 2019-05-30 18:09:11 UTC
Thanks for the clarification.