biggestsonicfan / i960-CTOOLS-with-NINDY

A repo in which i960 CTOOLS and NINDY are mirrored and a work in progress for binaries will be.
4 stars 2 forks source link

undefined reference to `__errno_ptr' #4

Open biggestsonicfan opened 4 years ago

biggestsonicfan commented 4 years ago

When executing the final linking for NINDY I960BASE=~/i960-CTOOLS-with-NINDY/i386-nbsd1-ctools ../i386-nbsd1-ctools/bin/lnk960 -o qtrom lib/qtrom_test.ld kx/kx_init.o basefile.ofp.o float.o kx/kx.a qt960/qt.a -lckb the following errors occur:

/home/rob/i960-CTOOLS-with-NINDY/i386-nbsd1-ctools/lib/libmkb.a(logd.o): undefined reference to __errno_ptr' /home/rob/i960-CTOOLS-with-NINDY/i386-nbsd1-ctools/lib/libmkb.a(logd.o): undefined reference toerrno_ptr' /home/rob/i960-CTOOLS-with-NINDY/i386-nbsd1-ctools/lib/libmkb.a(logd.o): undefined reference to __errno_ptr' /home/rob/i960-CTOOLS-with-NINDY/i386-nbsd1-ctools/lib/libmkb.a(logd.o): undefined reference toerrno_ptr' /home/rob/i960-CTOOLS-with-NINDY/i386-nbsd1-ctools/lib/libmkb.a(powd.o): undefined reference to __errno_ptr' /home/rob/i960-CTOOLS-with-NINDY/i386-nbsd1-ctools/lib/libmkb.a(powd.o): more references to__errno_ptr' follow ../i386-nbsd1-ctools/bin/lnk960: Can not perform relocation. ../i386-nbsd1-ctools/bin/lnk960: Fatal error. Output file: qtrom was not created.

Sadly, "libmkb.a" is a precompiled binary. The source code for it is located in this directory.

Unsure how to proceed.

EDIT1: The error may be refering to this here?

EDIT2: Information from the NINDY User's Manual regarding this final link:

lnk -o qtrom lib\qtrom.ld kx\kx_init.o basefile.o fp.o float.o fp_flt.o kx\kx.a qt960\qt.a -lckb The -o switch names the output file "qtrom". We are using "qtrom.ld" from the .\LIB directory (If you change "qtrom.ld"" in LIBQT or CRT, be sure you use your new version here). We link the initialization file, "kx_init.o", from the KX directory, the "basefile.o" file (created in step 4), the floating point files, "kx.a" (created in step 2) from the KX direcotry, "qt.a" (created in step 1) from the QT960 directory, and "libckb.a" (-lckb).

Perhaps "libmkb.a" is being called somehow instead of "libckb.a"?

EDIT2: A verbose log may be more hepful:

Linker will behave like lnk960 lib/qtrom_test.ld attempt to open kx/kx_init.o succeeded kx/kx_init.o attempt to open basefile.o succeeded basefile.o attempt to open fp.o succeeded fp.o attempt to open float.o succeeded float.o attempt to open kx/kx.a succeeded kx_break.o kx.o kx_ftbl.o attempt to open qt960/qt.a succeeded test_cal.o qt_hw.o tests.o test_tim.o copymem.o test_int.o test_asm.o flash.o qt_io.o qt_data.o attempt to open /home/rob/i960-CTOOLS-with-NINDY/i386-nbsd1-ctools/lib/ckb.a failed attempt to open ./ckb.a failed attempt to open /home/rob/i960-CTOOLS-with-NINDY/i386-nbsd1-ctools/lib/libckb.a succeeded isupper.o tolower.o strchr.o strcmp.o strcpy.o strlen.o strncmp.o ctype.o attempt to open /home/rob/i960-CTOOLS-with-NINDY/i386-nbsd1-ctools/lib/c.a failed attempt to open ./c.a failed attempt to open /home/rob/i960-CTOOLS-with-NINDY/i386-nbsd1-ctools/lib/libc.a failed attempt to open ./libc.a failed attempt to open /home/rob/i960-CTOOLS-with-NINDY/i386-nbsd1-ctools/lib/ckb.a failed attempt to open ./ckb.a failed attempt to open /home/rob/i960-CTOOLS-with-NINDY/i386-nbsd1-ctools/lib/libckb.a succeeded attempt to open /home/rob/i960-CTOOLS-with-NINDY/i386-nbsd1-ctools/lib/m.a failed attempt to open ./m.a failed attempt to open /home/rob/i960-CTOOLS-with-NINDY/i386-nbsd1-ctools/lib/libm.a failed attempt to open ./libm.a failed attempt to open /home/rob/i960-CTOOLS-with-NINDY/i386-nbsd1-ctools/lib/mkb.a failed attempt to open ./mkb.a failed attempt to open /home/rob/i960-CTOOLS-with-NINDY/i386-nbsd1-ctools/lib/libmkb.a succeeded logd.o powd.o _class.o constant.o fp_exits.o _isnan.o _nan.o rem.o round.o copysign.o environ.o scale.o exp2m1.o log_sup.o Allocating output section: .text to address: 0x0 size: 60116 Allocating output section: .data to address: 0x801c000 size: 480 Allocating output section: .bss to address: 0x801c200 size: 11716 /home/rob/i960-CTOOLS-with-NINDY/i386-nbsd1-ctools/lib/libmkb.a(logd.o): undefined reference to __errno_ptr' /home/rob/i960-CTOOLS-with-NINDY/i386-nbsd1-ctools/lib/libmkb.a(logd.o): undefined reference toerrno_ptr' /home/rob/i960-CTOOLS-with-NINDY/i386-nbsd1-ctools/lib/libmkb.a(logd.o): undefined reference to __errno_ptr' /home/rob/i960-CTOOLS-with-NINDY/i386-nbsd1-ctools/lib/libmkb.a(logd.o): undefined reference toerrno_ptr' /home/rob/i960-CTOOLS-with-NINDY/i386-nbsd1-ctools/lib/libmkb.a(powd.o): undefined reference to __errno_ptr' /home/rob/i960-CTOOLS-with-NINDY/i386-nbsd1-ctools/lib/libmkb.a(powd.o): more references to__errno_ptr' follow ../i386-nbsd1-ctools/bin/lnk960: Can not perform relocation. ../i386-nbsd1-ctools/bin/lnk960: Fatal error. Output file: qtrom was not created.

EDIT3: More information about this file from the i960 Processor Library Supplement

ibm ANSI Math Functions This library contains the ANSI C standard math functions.The libst.a library provides minimal function definitions to resolve external references during linking without adding the unnecessary code for full floating-point functionality. Use this library instead of libmxx.a if your program does not perform any floating-point number operations. The functions in libst.a do nothing more than resolve external references, so you can link this library with PID programs, and with any architecture.

EDIT4: Even MORE information from the i960 Processor Library Supplement

Creating Pointers to Data All library functions that access thread or context data use one of thefollowing access functions to obtain a pointer to the data: _errno_ptr returns a pointer to the errno flag. _exit_ptr returns a pointer to the exit lists. _stdio_ptr returns a pointer to the standard streams _thread_ptr returns a pointer to the block of memory unique to the calling thread To return the same pointers as _exit_create, _stdio_create, and _thread_create for the current thread, the access functions you write must use the information used by the execution environment to manage the threads of execution. The file _create.c contains sample source code for these functions in a single-thread (not reentrant) implementation. The errno macro contains a value indicating the cause of the most recent error that has occurred in execution. The address of errnois the value returned from the _errno_ptr and _thread_create functions. Any function that can set errno must be able to write to that address.

EDIT5: Greatest hits from "I can't believe it's more info": [Ref 5-20]

_errno_ptr : Get a pointer to theerrno variable. struct _stdio *_errno_ptr (void); Header File: reent.h Discussion: This function provides a pointer to errno variable for the current thread Returns: The address of the errno variable for the current thread.

Are all these files missing the header file?

DrItanium commented 4 years ago

So you'll have to see if the nm that ships with CTOOLS can locate those missing symbols among all of .o and .a files you have. You'll then have to make sure that those objects/archives come in the proper order during linking (symbol need followed by symbol provider). One of the more annoying parts of these archives is that they are technically malformed in their header and do not contain <!arch> at the beginning (they contain !) which is annoying.

Check and see if you can't link using the compiler instead of the linker directly. If you can then you can dump the command line the compiler runs to find out what you are missing and the order to place the arguments on the command line in.

However, in this case, I found that libll.a has the corresponding __errno_ptr. libll is the low-level library. There are four forms of it for different targets, but I think that is the missing library.

biggestsonicfan commented 4 years ago

See attachment for nm output of libmkb.a (renamed .old as I recompiled it already) libmkb.txt.

Running with gcc960 seems to get further along, as it goes to the compiler first and then the linker, as verified by a verbose output:

G960BASE=~/i960-CTOOLS-with-NINDY/i386-nbsd1-ctools ../i386-nbsd1-ctools/bin/gcc960 -o qtrom lib/qtrom_test.ld kx/kx_init.o basefile.o fp.o float.o kx/kx.a qt960/qt.a -lckb -V gcc960 Version 5.0.4032 Thu Oct 17 16:01:16 EDT 1996 Intel 80960 Linker 5.0, Thu Oct 17 16:05:57 EDT 1996 /home/rob/i960-CTOOLS-with-NINDY/i386-nbsd1-ctools/bin/gld960: No such file or directory /home/rob/i960-CTOOLS-with-NINDY/i386-nbsd1-ctools/lib/crt960.o

Possibly related, a quick search shows a hit in the MON960 Debug Monitor User's Guide with both the file you mentioned and the file erroring here:

The monitor attempts to be transparent and non-intrusive to application programs by using minimal processor resources. When you are debugging a program under the monitor (setting breakpoints, displaying registers,displaying memory, single-stepping), the processor actually alternates between executing your application program and executing the monitor.Programs linked to run with the monitor must be linked with the crt960.o and libll.a library files. The libll.a file provides links between low-level I/O routines in the monitor and the high-level C library I/O calls.The run-time initialization for your program is provided by crt960.o.Your application program is sandwiched between a startup routine and anexit routine. The startup routine sets up the stack and the arithmetic-controls register, initializes the libraries, and calls main(). If main() ever returns, the startup routine calls exit().

EDIT1: Managed to enter the src/lib/libll directory and make both libll.a and crt960.o EDIT2: There is a libll.a in the ctools lib directory, so here's the nm of that: libll.txt

EDIT3: Here's what happens if I try to compile, not link, with the crt960.o in the place it's looking for. Big oof:

localhost$ G960BASE=~/i960-CTOOLS-with-NINDY/i386-nbsd1-ctools/ I960BASE=~/i960-CTOOLS-with-NINDY/i386-nbsd1-ctools/ ../i386-nbsd1-ctools/bin/gcc960 -o qtrom lib/qtrom_test.ld kx/kx_init.o basefile.o fp.o float.o kx/kx.a qt960/qt.a -lckb /home/rob/i960-CTOOLS-with-NINDY/i386-nbsd1-ctools//lib/crt960.o: undefined reference to _stackbase' /home/rob/i960-CTOOLS-with-NINDY/i386-nbsd1-ctools//lib/crt960.o: undefined reference toLL_init' /home/rob/i960-CTOOLS-with-NINDY/i386-nbsd1-ctools//lib/crt960.o: undefined reference to __arg_init' /home/rob/i960-CTOOLS-with-NINDY/i386-nbsd1-ctools//lib/libckb.a(init_c.o): undefined reference toLL_init' /home/rob/i960-CTOOLS-with-NINDY/i386-nbsd1-ctools//lib/libckb.a(init_c.o): undefined reference to `arg_init' /home/rob/i960-CTOOLS-with-NINDY/i386-nbsd1-ctools//lib/libckb.a(atexit.o): undefined reference to `exit_ptr' /home/rob/i960-CTOOLS-with-NINDY/i386-nbsd1-ctools//lib/libckb.a(atexit.o): undefined reference to __semaphore_wait' /home/rob/i960-CTOOLS-with-NINDY/i386-nbsd1-ctools//lib/libckb.a(atexit.o): undefined reference tosemaphore_signal' /home/rob/i960-CTOOLS-with-NINDY/i386-nbsd1-ctools//lib/libckb.a(atexit.o): undefined reference to __semaphore_signal' /home/rob/i960-CTOOLS-with-NINDY/i386-nbsd1-ctools//lib/libckb.a(exit.o): undefined reference toexit_ptr' /home/rob/i960-CTOOLS-with-NINDY/i386-nbsd1-ctools//lib/libckb.a(exit.o): undefined reference to __semaphore_wait' /home/rob/i960-CTOOLS-with-NINDY/i386-nbsd1-ctools//lib/libckb.a(exit.o): undefined reference tosemaphore_signal' /home/rob/i960-CTOOLS-with-NINDY/i386-nbsd1-ctools//lib/libckb.a(exit.o): undefined reference to __semaphore_signal' /home/rob/i960-CTOOLS-with-NINDY/i386-nbsd1-ctools//lib/libckb.a(exit.o): undefined reference tosemaphore_wait' /home/rob/i960-CTOOLS-with-NINDY/i386-nbsd1-ctools//lib/libckb.a(exit.o): undefined reference to __semaphore_signal' /home/rob/i960-CTOOLS-with-NINDY/i386-nbsd1-ctools//lib/libckb.a(exit.o): undefined reference to_c_term' /home/rob/i960-CTOOLS-with-NINDY/i386-nbsd1-ctools//lib/libckb.a(exit.o): undefined reference to __exit' /home/rob/i960-CTOOLS-with-NINDY/i386-nbsd1-ctools//lib/libckb.a(_exit_in.o): undefined reference toexit_create' /home/rob/i960-CTOOLS-with-NINDY/i386-nbsd1-ctools//lib/libckb.a(_exit_in.o): undefined reference to __errno_ptr' /home/rob/i960-CTOOLS-with-NINDY/i386-nbsd1-ctools//lib/libckb.a(_exit_in.o): undefined reference tosemaphore_init' /home/rob/i960-CTOOLS-with-NINDY/i386-nbsd1-ctools//lib/libckb.a(_exit_in.o): undefined reference to __semaphore_init' /home/rob/i960-CTOOLS-with-NINDY/i386-nbsd1-ctools//lib/libckb.a(_stdio_i.o): undefined reference tostdio_create' /home/rob/i960-CTOOLS-with-NINDY/i386-nbsd1-ctools//lib/libckb.a(_stdio_i.o): undefined reference to __errno_ptr' /home/rob/i960-CTOOLS-with-NINDY/i386-nbsd1-ctools//lib/libckb.a(_stdio_i.o): undefined reference tostdio_stdopen' /home/rob/i960-CTOOLS-with-NINDY/i386-nbsd1-ctools//lib/libckb.a(_stdio_i.o): undefined reference to __semaphore_init' /home/rob/i960-CTOOLS-with-NINDY/i386-nbsd1-ctools//lib/libckb.a(_stdio_i.o): undefined reference tostdio_stdopen' /home/rob/i960-CTOOLS-with-NINDY/i386-nbsd1-ctools//lib/libckb.a(_stdio_i.o): undefined reference to _isatty' /home/rob/i960-CTOOLS-with-NINDY/i386-nbsd1-ctools//lib/libckb.a(_stdio_i.o): undefined reference tosemaphore_init' /home/rob/i960-CTOOLS-with-NINDY/i386-nbsd1-ctools//lib/libckb.a(_stdio_i.o): undefined reference to __stdio_stdopen' /home/rob/i960-CTOOLS-with-NINDY/i386-nbsd1-ctools//lib/libckb.a(_stdio_i.o): undefined reference to_isatty' /home/rob/i960-CTOOLS-with-NINDY/i386-nbsd1-ctools//lib/libckb.a(_stdio_i.o): undefined reference to __semaphore_init' /home/rob/i960-CTOOLS-with-NINDY/i386-nbsd1-ctools//lib/libckb.a(_stdio_i.o): undefined reference toexit_ptr' /home/rob/i960-CTOOLS-with-NINDY/i386-nbsd1-ctools//lib/libckb.a(_stdio_i.o): undefined reference to __semaphore_wait' /home/rob/i960-CTOOLS-with-NINDY/i386-nbsd1-ctools//lib/libckb.a(_stdio_i.o): undefined reference toexit_ptr' /home/rob/i960-CTOOLS-with-NINDY/i386-nbsd1-ctools//lib/libckb.a(_stdio_i.o): undefined reference to __stdio_ptr' /home/rob/i960-CTOOLS-with-NINDY/i386-nbsd1-ctools//lib/libckb.a(_stdio_i.o): undefined reference tostdio_ptr' /home/rob/i960-CTOOLS-with-NINDY/i386-nbsd1-ctools//lib/libckb.a(_stdio_i.o): undefined reference to __exit_ptr' /home/rob/i960-CTOOLS-with-NINDY/i386-nbsd1-ctools//lib/libckb.a(_stdio_i.o): undefined reference tostdio_ptr' /home/rob/i960-CTOOLS-with-NINDY/i386-nbsd1-ctools//lib/libckb.a(_stdio_i.o): undefined reference to __exit_ptr' /home/rob/i960-CTOOLS-with-NINDY/i386-nbsd1-ctools//lib/libckb.a(_stdio_i.o): undefined reference tosemaphore_signal' /home/rob/i960-CTOOLS-with-NINDY/i386-nbsd1-ctools//lib/libckb.a(thread.o): undefined reference to __thread_create' /home/rob/i960-CTOOLS-with-NINDY/i386-nbsd1-ctools//lib/libckb.a(fclose.o): undefined reference to_close' /home/rob/i960-CTOOLS-with-NINDY/i386-nbsd1-ctools//lib/libckb.a(fclose.o): undefined reference to __semaphore_delete' /home/rob/i960-CTOOLS-with-NINDY/i386-nbsd1-ctools//lib/libckb.a(fclose.o): undefined reference tostdio_ptr' /home/rob/i960-CTOOLS-with-NINDY/i386-nbsd1-ctools//lib/libckb.a(fclose.o): undefined reference to __stdio_ptr' /home/rob/i960-CTOOLS-with-NINDY/i386-nbsd1-ctools//lib/libckb.a(fclose.o): undefined reference tostdio_ptr' /home/rob/i960-CTOOLS-with-NINDY/i386-nbsd1-ctools//lib/libckb.a(fclose.o): undefined reference to __exit_ptr' /home/rob/i960-CTOOLS-with-NINDY/i386-nbsd1-ctools//lib/libckb.a(fclose.o): undefined reference tosemaphore_wait' /home/rob/i960-CTOOLS-with-NINDY/i386-nbsd1-ctools//lib/libckb.a(fclose.o): undefined reference to __exit_ptr' /home/rob/i960-CTOOLS-with-NINDY/i386-nbsd1-ctools//lib/libckb.a(fclose.o): undefined reference toexit_ptr' /home/rob/i960-CTOOLS-with-NINDY/i386-nbsd1-ctools//lib/libckb.a(fclose.o): undefined reference to __semaphore_signal' /home/rob/i960-CTOOLS-with-NINDY/i386-nbsd1-ctools//lib/libckb.a(fflush.o): undefined reference toerrno_ptr' /home/rob/i960-CTOOLS-with-NINDY/i386-nbsd1-ctools//lib/libckb.a(fflush.o): undefined reference to __semaphore_wait' /home/rob/i960-CTOOLS-with-NINDY/i386-nbsd1-ctools//lib/libckb.a(fflush.o): undefined reference to_write' /home/rob/i960-CTOOLS-with-NINDY/i386-nbsd1-ctools//lib/libckb.a(fflush.o): undefined reference to __map_length' /home/rob/i960-CTOOLS-with-NINDY/i386-nbsd1-ctools//lib/libckb.a(fflush.o): undefined reference to_lseek' /home/rob/i960-CTOOLS-with-NINDY/i386-nbsd1-ctools//lib/libckb.a(fflush.o): undefined reference to __semaphore_signal' /home/rob/i960-CTOOLS-with-NINDY/i386-nbsd1-ctools//lib/libckb.a(remove.o): undefined reference to_unlink' /home/rob/i960-CTOOLS-with-NINDY/i386-nbsd1-ctools//lib/libckb.a(flushall.o): undefined reference to __exit_ptr' /home/rob/i960-CTOOLS-with-NINDY/i386-nbsd1-ctools//lib/libckb.a(flushall.o): undefined reference tosemaphore_wait' /home/rob/i960-CTOOLS-with-NINDY/i386-nbsd1-ctools//lib/libckb.a(flushall.o): undefined reference to __exit_ptr' /home/rob/i960-CTOOLS-with-NINDY/i386-nbsd1-ctools//lib/libckb.a(flushall.o): undefined reference toexit_ptr' /home/rob/i960-CTOOLS-with-NINDY/i386-nbsd1-ctools//lib/libckb.a(flushall.o): undefined reference to __semaphore_signal' /home/rob/i960-CTOOLS-with-NINDY/i386-nbsd1-ctools//lib/libckb.a(malloc.o): undefined reference to_sbrk' /home/rob/i960-CTOOLS-with-NINDY/i386-nbsd1-ctools//lib/libckb.a(malloc.o): undefined reference to __errno_ptr' /home/rob/i960-CTOOLS-with-NINDY/i386-nbsd1-ctools//lib/libckb.a(malloc.o): undefined reference to_sbrk' /home/rob/i960-CTOOLS-with-NINDY/i386-nbsd1-ctools//lib/libckb.a(malloc.o): undefined reference to _sbrk' /home/rob/i960-CTOOLS-with-NINDY/i386-nbsd1-ctools//lib/libckb.a(malloc.o): undefined reference toerrno_ptr' /home/rob/i960-CTOOLS-with-NINDY/i386-nbsd1-ctools//lib/libckb.a(malloc.o): undefined reference to __errno_ptr' /home/rob/i960-CTOOLS-with-NINDY/i386-nbsd1-ctools//lib/libckb.a(raise.o): undefined reference toerrno_ptr' /home/rob/i960-CTOOLS-with-NINDY/i386-nbsd1-ctools//lib/libckb.a(signal.o): undefined reference to __errno_ptr' /home/rob/i960-CTOOLS-with-NINDY/i386-nbsd1-ctools//lib/libckb.a(signal.o): undefined reference tosig_null' /home/rob/i960-CTOOLS-with-NINDY/i386-nbsd1-ctools//lib/libckb.a(signal.o): undefined reference to __sig_null' /home/rob/i960-CTOOLS-with-NINDY/i386-nbsd1-ctools//lib/libckb.a(signal.o): undefined reference tosig_null' /home/rob/i960-CTOOLS-with-NINDY/i386-nbsd1-ctools//lib/libckb.a(signal.o): undefined reference to __sig_ill_dfl' /home/rob/i960-CTOOLS-with-NINDY/i386-nbsd1-ctools//lib/libckb.a(signal.o): undefined reference tosig_int_dfl' /home/rob/i960-CTOOLS-with-NINDY/i386-nbsd1-ctools//lib/libckb.a(signal.o): undefined reference to `sig_alloc_dfl' /home/rob/i960-CTOOLS-with-NINDY/i386-nbsd1-ctools//lib/libckb.a(signal.o): undefined reference to __sig_free_dfl' /home/rob/i960-CTOOLS-with-NINDY/i386-nbsd1-ctools//lib/libckb.a(signal.o): undefined reference tosig_term_dfl' /home/rob/i960-CTOOLS-with-NINDY/i386-nbsd1-ctools//lib/libckb.a(signal.o): undefined reference to `sig_read_dfl' /home/rob/i960-CTOOLS-with-NINDY/i386-nbsd1-ctools//lib/libckb.a(signal.o): undefined reference to __sig_write_dfl' /home/rob/i960-CTOOLS-with-NINDY/i386-nbsd1-ctools//lib/libckb.a(signal.o): undefined reference tosig_fpe_dfl' /home/rob/i960-CTOOLS-with-NINDY/i386-nbsd1-ctools//lib/libckb.a(signal.o): undefined reference to `sig_segv_dfl' /home/rob/i960-CTOOLS-with-NINDY/i386-nbsd1-ctools//lib/libckb.a(signal.o): undefined reference to __sig_abrt_dfl' /home/rob/i960-CTOOLS-with-NINDY/i386-nbsd1-ctools//lib/libckb.a(signal.o): undefined reference tosig_null' /home/rob/i960-CTOOLS-with-NINDY/i386-nbsd1-ctools//lib/libckb.a(signal.o): undefined reference to __sig_ill_dfl' /home/rob/i960-CTOOLS-with-NINDY/i386-nbsd1-ctools//lib/libckb.a(signal.o): undefined reference tosig_int_dfl' /home/rob/i960-CTOOLS-with-NINDY/i386-nbsd1-ctools//lib/libckb.a(signal.o): undefined reference to `sig_alloc_dfl' /home/rob/i960-CTOOLS-with-NINDY/i386-nbsd1-ctools//lib/libckb.a(signal.o): undefined reference to __sig_free_dfl' /home/rob/i960-CTOOLS-with-NINDY/i386-nbsd1-ctools//lib/libckb.a(signal.o): undefined reference tosig_term_dfl' /home/rob/i960-CTOOLS-with-NINDY/i386-nbsd1-ctools//lib/libckb.a(signal.o): undefined reference to `sig_read_dfl' /home/rob/i960-CTOOLS-with-NINDY/i386-nbsd1-ctools//lib/libckb.a(signal.o): undefined reference to __sig_write_dfl' /home/rob/i960-CTOOLS-with-NINDY/i386-nbsd1-ctools//lib/libckb.a(signal.o): undefined reference tosig_fpe_dfl' /home/rob/i960-CTOOLS-with-NINDY/i386-nbsd1-ctools//lib/libckb.a(signal.o): undefined reference to `sig_segv_dfl' /home/rob/i960-CTOOLS-with-NINDY/i386-nbsd1-ctools//lib/libckb.a(signal.o): undefined reference to __sig_abrt_dfl' /home/rob/i960-CTOOLS-with-NINDY/i386-nbsd1-ctools//lib/libmkb.a(logd.o): undefined reference to__errno_ptr' /home/rob/i960-CTOOLS-with-NINDY/i386-nbsd1-ctools//lib/libmkb.a(logd.o): undefined reference to `errno_ptr' /home/rob/i960-CTOOLS-with-NINDY/i386-nbsd1-ctools//lib/libmkb.a(logd.o): undefined reference to __errno_ptr' /home/rob/i960-CTOOLS-with-NINDY/i386-nbsd1-ctools//lib/libmkb.a(logd.o): undefined reference toerrno_ptr' /home/rob/i960-CTOOLS-with-NINDY/i386-nbsd1-ctools//lib/libmkb.a(powd.o): undefined reference to __errno_ptr' /home/rob/i960-CTOOLS-with-NINDY/i386-nbsd1-ctools//lib/libmkb.a(powd.o): more references toerrno_ptr' follow /home/rob/i960-CTOOLS-with-NINDY/i386-nbsd1-ctools//bin/gld960: Can not perform relocation. /home/rob/i960-CTOOLS-with-NINDY/i386-nbsd1-ctools//bin/gld960: Fatal error. Output file: qtrom was not created.

EDIT4: It's interesting to note that _errno_ptr is not in the reent.h header file, but other definitions found in the library suppliment, such as _semaphore_signal, are in the reent.h file...

EDIT5: I think I finally found the reference to __errno_ptr in gnu960/include/__macros.h

__EXTERN int* __CONST_FUNC (_errno_ptr)(__NO_PARMS);
#define __SETERRNO(VAL)  (*_errno_ptr() = (VAL))
#define __GETERRNO()     (*_errno_ptr())
#define _SETERRNO(VAL)   (*_errno_ptr() = (VAL))
#define _GETERRNO()      (*_errno_ptr())
#define __errno          (*_errno_ptr())

EDIT6: Ah, you were right. In the libll source code's _create.c is the following code:

int *_errno_ptr(void)
{
    return (&_thread_str.t.errno);
}

and each one of these ints within _create.c have a corresponding _EXTERN in reent.h except _errno_ptr EDIT7: A seemingly similar issue?

EDIT8: To summarize the libmkb.a nm960 output, these are the objects which have have the undefined reference:

ldexp.o:
sinh.o:
cosh.o:
error.o:
_fltscan.o:
afpcnvt.o:
atof.o:
acoss.o:
acosd.o:
asins.o:
asind.o:
atan.o:
exps.o:
expd.o:
logs.o:
logd.o:
loge.o:
pows.o:
powd.o:
sqrt.o:
DrItanium commented 4 years ago

libll doesn't seem to be on the line still when you use gcc960. What happens if you add -lll to the line?

biggestsonicfan commented 4 years ago

Well, I feel sheepish. I added the line to the lnk960 version of the command but it looks like adding it to the gcc960 version did the trick to remove that particular error!

localhost$ G960BASE=~/i960-CTOOLS-with-NINDY/i386-nbsd1-ctools/ I960BASE=~/i960-CTOOLS-with-NINDY/i386-nbsd1-ctools/ ../i386-nbsd1-ctools/bin/gcc960 -o qtrom lib/qtrom_test.ld kx/kx_init.o basefile.o fp.o float.o kx/kx.a qt960/qt.a -lckb -lll -v
gcc960 Version 5.0.4032 Thu Oct 17 16:01:16 EDT 1996
 /home/rob/i960-CTOOLS-with-NINDY/i386-nbsd1-ctools//bin/gld960 -o qtrom -V -AKB /home/rob/i960-CTOOLS-with-NINDY/i386-nbsd1-ctools//lib/crt960.o lib/qtrom_test.ld kx/kx_init.o basefile.o fp.o float.o kx/kx.a qt960/qt.a -lckb -lll -lqf -lc -lm -c960 /tmp/cc04529a.gt1
Intel 80960 Linker 5.0, Thu Oct 17 16:05:57 EDT 1996
/home/rob/i960-CTOOLS-with-NINDY/i386-nbsd1-ctools//lib/libll.a(_create.o): multiple definition of `__thread_ptr (.text)'
basefile.o errno.c:0: (_thread_ptr): first seen here
/home/rob/i960-CTOOLS-with-NINDY/i386-nbsd1-ctools//lib/libll.a(_create.o): multiple definition of `_thread_ptr.lf (.text)'
basefile.o errno.c:0: (_thread_ptr): first seen here
/home/rob/i960-CTOOLS-with-NINDY/i386-nbsd1-ctools//lib/crt960.o: undefined reference to `_stackbase'
/home/rob/i960-CTOOLS-with-NINDY/i386-nbsd1-ctools//lib/libll.a(brk.o): undefined reference to `_heap_base'
/home/rob/i960-CTOOLS-with-NINDY/i386-nbsd1-ctools//lib/libll.a(brk.o): undefined reference to `_heap_end'
/home/rob/i960-CTOOLS-with-NINDY/i386-nbsd1-ctools//lib/libll.a(brk.o): undefined reference to `_heap_base'
/home/rob/i960-CTOOLS-with-NINDY/i386-nbsd1-ctools//lib/libll.a(brk.o): undefined reference to `_heap_end'
/home/rob/i960-CTOOLS-with-NINDY/i386-nbsd1-ctools//bin/gld960: Can not perform relocation.
/home/rob/i960-CTOOLS-with-NINDY/i386-nbsd1-ctools//bin/gld960: Fatal error.  Output file: qtrom was not created.

EDIT1: From crtnin.s:

/* set up stack pointer:
 *  The heap will begin at '_end';  its length is 'heap_size'
 *  bytes.  The stack will begin at the first 64-byte-aligned
 *  block after the heap.
 *
 *  A default value of 'heap_size' is set by linking with libnindy.a
 *  The default can be overridden by redefining this symbol at link
 *  time (with a line of the form 'heap_size=XXXX;' in the lnk960
 *  linker specification file; or one of the form
 *  "-defsym heap_size=XXXX" on the gld960 invocation line).
 */

Not sure if that has to do with the heap errors we are seeing though.

EDIT2: Closing this issue as this is a new issue.

biggestsonicfan commented 4 years ago

The suggestion of using gcc960 instead of lnk960 was a good one, but alas, the board refuses to work with anything with the final link done by gcc. Another work around will be needed.