xnec2c
xnec2c copied to clipboard
sparc64: xnec2c fails to link with "relocation truncated to fit" errors
When building the Debian sparc64 package we get the following errors. I'm not sure how to fix this so if someone has a sparc64 system to test on then reply to this issue and maybe we can troubleshoot.
Maybe using -fPIC
instead of -fpie
will fix it, but i don't have a way to test. I'm guessing something like LDFLAGS=-fPIC
or CFLAGS=-fPIC
could fix the problem. If there is a solution then I would like to see a patch to configure.ac
to detect when the flag is needed.
References:
- https://buildd.debian.org/status/package.php?p=xnec2c
- https://stackoverflow.com/a/10486230/14055985
- https://lists.debian.org/debian-sparc/2014/07/msg00037.html
- https://sourceforge.net/p/cdesktopenv/tickets/92/
Here is a snippet below, or the whole log is here:
/usr/bin/ld: warning: xnec2c has a LOAD segment with RWX permissions
xnec2c-resources.o: in function `xnec2c_get_resource':
./src/xnec2c-resources.c:51279:(.text+0x10): relocation truncated to fit: R_SPARC_GOT13 against `static_resource'
xnec2c-resources.o: in function `xnec2cresource_constructor':
./src/xnec2c-resources.c:51458:(.text.startup+0x10): relocation truncated to fit: R_SPARC_GOT13 against `static_resource'
xnec2c-resources.o: in function `xnec2cresource_destructor':
./src/xnec2c-resources.c:51463:(.text.exit+0x10): relocation truncated to fit: R_SPARC_GOT13 against `static_resource'
main.o: in function `opt_start_optimizer_thread':
./src/main.c:94:(.text+0x68): relocation truncated to fit: R_SPARC_GOT13 against symbol `main_window_builder' defined in .bss section in shared.o
main.o: in function `sig_handler':
./src/main.c:724:(.text+0x18c): relocation truncated to fit: R_SPARC_GOT13 against symbol `FORKED' defined in .bss section in shared.o
./src/main.c:725:(.text+0x1b0): relocation truncated to fit: R_SPARC_GOT13 against symbol `num_child_procs' defined in .bss section in shared.o
./src/main.c:725:(.text+0x1c4): relocation truncated to fit: R_SPARC_GOT13 against symbol `forked_proc_data' defined in .bss section in shared.o
./src/main.c:731:(.text+0x1fc): relocation truncated to fit: R_SPARC_GOT13 against symbol `input_fp' defined in .bss section in shared.o
./src/main.c:724:(.text+0x244): relocation truncated to fit: R_SPARC_GOT13 against symbol `FORKED' defined in .bss section in shared.o
./src/main.c:701:(.text+0x294): relocation truncated to fit: R_SPARC_GOT13 against symbol `FORKED' defined in .bss section in shared.o
./src/main.c:708:(.text+0x2a8): additional relocation overflows omitted from the output