Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 10 Mar 2000 17:27:06 -0600
From:      Oscar Bonilla <obonilla@fisicc-ufm.edu>
To:        Alfred Perlstein <bright@wintelcom.net>
Cc:        Oscar Bonilla <obonilla@fisicc-ufm.edu>, Kris Kennaway <kris@hub.freebsd.org>, freebsd-hackers@FreeBSD.ORG
Subject:   Re: inner workings of the C compiler
Message-ID:  <20000310172706.A93660@fisicc-ufm.edu>
In-Reply-To: <20000310152737.J14279@fw.wintelcom.net>
References:  <20000308163057.W14279@fw.wintelcom.net> <Pine.BSF.4.21.0003091719340.82270-100000@hub.freebsd.org> <20000310164428.A89006@fisicc-ufm.edu> <20000310152737.J14279@fw.wintelcom.net>

next in thread | previous in thread | raw e-mail | index | archive | help
On Fri, Mar 10, 2000 at 03:27:37PM -0800, Alfred Perlstein wrote:
> I think you'll want LD_LIBRARY_PATH to be:
> /home/obonilla/freebsd/nss/libc/:/usr/lib:/usr/local/lib

I don't see why since the only library I use is libc. Anyway, I tried
just for kicks and still got the same error.

$ echo $LD_LIBRARY_PATH
/home/obonilla/freebsd/nss/libc:/usr/lib:/usr/local/lib
$ echo $LD_PRELOAD 
/home/obonilla/freebsd/nss/libc/libc.so.4
$ make
cc -g -DYP -DFreeBSD -Wall -pedantic -ansi -o nss-test -I../../libc/include nss-test.c
/tmp/ccE93722.o: In function `main':
/home/obonilla/freebsd/nss/tests/libc/nss-test.c(.text+0xb0): undefined reference to `nsdispatch'
*** Error code 1

Stop in /usr/home/obonilla/freebsd/nss/tests/libc.

> please use the dynamic, it's a hell of a lot easier.

sure, as soon as it works I'll use it ;)

> probably, but without a traceback it's going to be hard to find
> out exactly what.
> 

$ cp Makefile.static Makefile
$ make
cc -g -DYP -DFreeBSD -Wall -pedantic -ansi -c -I../../libc/include nss-test.c
cc -g -nostdlib -static -L../../libc -o nss-test nss-test.o ../../csu/i386-elf/crt1.o ../../csu/i386-elf/crti.o -lc
$ ./nss-test 
files called
files called
retval = 1
NS_SUCCESS
Bus error (core dumped)
$ gdb nss-test nss-test.core 
GNU gdb 4.18
Copyright 1998 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "i386-unknown-freebsd"...
Core was generated by `nss-test'.
Program terminated with signal 10, Bus error.
#0  0x80528e4 in ?? ()
(gdb) where
#0  0x80528e4 in ?? ()
#1  0x80481ff in _start () at crt1.c:95
(gdb) 

as I said in the first mail, this has to do with crt1.c calling atexit()
with a valid address (0x80528e4) and somehow the argument to atexit()
getting to be NULL once inside atexit()...

I'd really like to use the dynamic stuff but I can't seem to make it
compile.

> Of course we are, please file a PR when you think it's pretty much
> completed or email -hackers if you need/want advice. :)

Ok, I'll start firing questions about NIS at -hackers

regards,

-oscar


-- 
pgp public key: finger obonilla@fisicc-ufm.edu
pgp fingerprint: 6D 18 8C 90 4C DF F0 4B  DF 35 1F 69 A1 33 C7 BC


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20000310172706.A93660>