* Question on glibc customization--exporting errno and __errno_location
@ 2005-01-02 3:12 Haizhi Xu
2005-01-02 23:54 ` Sohail Somani
0 siblings, 1 reply; 3+ messages in thread
From: Haizhi Xu @ 2005-01-02 3:12 UTC (permalink / raw)
To: gcc-help
Hi, all:
I need to customize the glibc to export 'errno' and 'errno_location' as
external symbol. Now I modified the include/errno.h and the following is
what I have changed.
--------- Original --------------
extern int errno attribute_hidden;
--------cusotmized as---------
extern int errno;
-----------Original------------
libc_hidden_proto(__errno_location)
-----------customized as----
//libc_hidden_proto(__errno_location)
Before my modifications, my glibc compiles. After my modification, I have
the following errors:
gcc -shared -static-libgcc -Wl,-O1 -Wl,-z,defs
-Wl,-dynamic-linker=/home/hxu02/glibc/lib/ld-linux.so.2
-B/home/hxu02/libc/glibccompile/csu/
-Wl,--version-script=/home/hxu02/libc/glibccompile/libc.map
-Wl,-soname=libc.so.6 -Wl,-z,combreloc -nostdlib -nostartfiles -e
__libc_main -u __register_frame -L/home/hxu02/libc/glibccompile
-L/home/hxu02/libc/glibccompile/math -L/home/hxu02/libc/glibccompile/elf
-L/home/hxu02/libc/glibccompile/dlfcn -L/home/hxu02/libc/glibccompile/nss
-L/home/hxu02/libc/glibccompile/nis -L/home/hxu02/libc/glibccompile/rt
-L/home/hxu02/libc/glibccompile/resolv -L/home/hxu02/libc/glibccompile/crypt
-L/home/hxu02/libc/glibccompile/linuxthreads
-Wl,-rpath-link=/home/hxu02/libc/glibccompile:/home/hxu02/libc/glibccompile/math:/home/hxu02/libc/glibccompile/elf:/home/hxu02/libc/glibccompile/dlfcn:/home/hxu02/libc/glibccompile/nss:/home/hxu02/libc/glibccompile/nis:/home/hxu02/libc/glibccompile/rt:/home/hxu02/libc/glibccompile/resolv:/home/hxu02/libc/glibccompile/crypt:/home/hxu02/libc/glibccompile/linuxthreads
-o /home/hxu02/libc/glibccompile/libc.so -T
/home/hxu02/libc/glibccompile/libc.so.lds
/home/hxu02/libc/glibccompile/csu/abi-note.o
/home/hxu02/libc/glibccompile/elf/soinit.os
/home/hxu02/libc/glibccompile/libc_pic.os /home/hxu02/libc/gli
bccompile/elf/sofini.os /home/hxu02/libc/glibccompile/elf/interp.os
/home/hxu02/libc/glibccompile/elf/ld.so -lgcc
/home/hxu02/libc/glibccompile/libc_pic.os(.text+0x235): In function
`check_one_fd':
../sysdeps/generic/check_fds.c:71: undefined reference to `__errno_location'
/home/hxu02/libc/glibccompile/libc_pic.os(.text+0x6cc): In function
`iconv_open':
/home/hxu02/libc/glibc-2.3.2/iconv/iconv_open.c:60: undefined reference to
`__errno_location'
/home/hxu02/libc/glibccompile/libc_pic.os(.text+0x889): In function `iconv':
/home/hxu02/libc/glibc-2.3.2/iconv/iconv.c:67: undefined reference to
`__errno_location'
/home/hxu02/libc/glibccompile/libc_pic.os(.text+0x8b5):/home/hxu02/libc/glibc-2.3.2/iconv/iconv.c:77:
undefined reference to `__errno_location'
/home/hxu02/libc/glibccompile/libc_pic.os(.text+0x8c5):/home/hxu02/libc/glibc-2.3.2/iconv/iconv.c:72:
undefined reference to `__errno_location'
/home/hxu02/libc/glibccompile/libc_pic.os(.text+0x8d5):/home/hxu02/libc/glibc-2.3.2/iconv/iconv.c:82:
more undefined references to `__errno_location' follow
collect2: ld returned 1 exit status
make[1]: *** [/home/hxu02/libc/glibccompile/libc.so] Error 1
make[1]: Leaving directory `/home/hxu02/libc/glibc-2.3.2'
make: *** [all] Error 2
[hxu02@future glibccompile]$
Thank you for your help.
Haizhi
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Question on glibc customization--exporting errno and __errno_location
2005-01-02 3:12 Question on glibc customization--exporting errno and __errno_location Haizhi Xu
@ 2005-01-02 23:54 ` Sohail Somani
2005-01-03 2:23 ` Question on glibc customization--exporting errno and__errno_location Haizhi Xu
0 siblings, 1 reply; 3+ messages in thread
From: Sohail Somani @ 2005-01-02 23:54 UTC (permalink / raw)
To: Haizhi Xu; +Cc: gcc-help
On Sun, 2005-01-02 at 03:11 +0000, Haizhi Xu wrote:
> Hi, all:
> I need to customize the glibc to export 'errno' and 'errno_location' as
> external symbol. Now I modified the include/errno.h and the following is
> what I have changed.
> ...
Did you try a clean build?
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Question on glibc customization--exporting errno and__errno_location
2005-01-02 23:54 ` Sohail Somani
@ 2005-01-03 2:23 ` Haizhi Xu
0 siblings, 0 replies; 3+ messages in thread
From: Haizhi Xu @ 2005-01-03 2:23 UTC (permalink / raw)
To: sohail; +Cc: gcc-help
>>On Sun, 2005-01-02 at 03:11 +0000, Haizhi Xu wrote:
> > Hi, all:
> > I need to customize the glibc to export 'errno' and 'errno_location' as
> > external symbol. Now I modified the include/errno.h and the following is
> > what I have changed.
> > ...
>
>Did you try a clean build?
>
Yes, I did and it did not work.
I have solved the problem. I found that I need to modify both the errno.h
and ./linuxthreads/sysdeps/pthread/errno-loc.c
Thanks a lot, any way.
Haizhi
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2005-01-03 2:23 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-01-02 3:12 Question on glibc customization--exporting errno and __errno_location Haizhi Xu
2005-01-02 23:54 ` Sohail Somani
2005-01-03 2:23 ` Question on glibc customization--exporting errno and__errno_location Haizhi Xu
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).