This is the mail archive of the newlib@sources.redhat.com mailing list for the newlib project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Using an extra installed newlib 1.8.2 on cygwin


Hello,

I tried to link a small HelloWorld program against newlib 1.8.2 that was
installed on cygwin, i.e.

1. I downloaded newlib1.8.2
2. I configured newlib for cygwin (just configure)
3. 'make' and 'make install' for newlib
4. I compiled hello.c and linked it against newlib:

newlib is installed in /usr/local/newlib-1.8.2

When compiling with:
gcc -nostdinc  -I/lib/gcc-lib/i686-pc-cygwin/2.95.2-4/include  -I/usr/local/
newlib-1.8.2/i686-pc-cygwin/include -L/usr/local/newlib-1.8.2/i686-pc-cygwin
/lib -Wl,-Map=hello.map  hello.c -lc

I get the link error:
/usr/lib/libcygwin.a(_cygwin_crt0_common.o)(.bss+0x0):_cygwin_crt0_c:
multiple definition of `_impure_ptr'
/usr/local/newlib-1.8.2/i686-pc-cygwin/lib/libc.a(impure.o)(.data+0x2ec):/ho
me/merker/pecoslocal/build-newlib-cygwin/i686-pc-cygwin/newlib/libc/reent/..
/../../../../newlib-1.8.2/newlib/libc/reent/impure.c: first defined here
collect2: ld returned 1 exit status

Even worse when I link newlib's crt0.o:

gcc -nostdinc  -I/lib/gcc-lib/i686-pc-cygwin/2.95.2-4/include  -I/usr/local/
newlib-1.8.2/i686-pc-cygwin/include -L/usr/local/newlib-1.8.2/i686-pc-cygwin
/lib -Wl,-Map=hello.map  /usr/local/newlib-1.8.2/i686-pc-cygwin/lib/crt0.o
hello.c -lc

/usr/local/newlib-1.8.2/i686-pc-cygwin/lib/crt0.o: In function
`mainCRTStartup':
/home/merker/pecoslocal/build-newlib-cygwin/i686-pc-cygwin/newlib/libc/sys/c
ygwin/../../../../../../newlib-1.8.2/newlib/libc/sys/cygwin/crt0.c:30:
multiple definition of `mainCRTStartup'
/usr/lib/crt0.o(.text+0x0):crt0.c: first defined here
/usr/local/newlib-1.8.2/i686-pc-cygwin/lib/crt0.o: In function
`mainCRTStartup':
/home/merker/pecoslocal/build-newlib-cygwin/i686-pc-cygwin/newlib/libc/sys/c
ygwin/../../../../../../newlib-1.8.2/newlib/libc/sys/cygwin/crt0.c:30:
multiple definition of `__cygwin_crt0_bp'
/usr/lib/crt0.o(.data+0x0):crt0.c: first defined here
/usr/lib/libcygwin.a(_cygwin_crt0_common.o)(.bss+0x0):_cygwin_crt0_c:
multiple definition of `_impure_ptr'
/usr/local/newlib-1.8.2/i686-pc-cygwin/lib/libc.a(impure.o)(.data+0x2ec):/ho
me/merker/pecoslocal/build-newlib-cygwin/i686-pc-cygwin/newlib/libc/reent/..
/../../../../newlib-1.8.2/newlib/libc/reent/impure.c: first defined here
collect2: ld returned 1 exit status

Any ideas on how to get this running? Background: For simulation purposes I
want to use the same library on cygwin as I'm using on an embedded target.

Thanks, Stephan

---
| Stephan Merker                merker@decrc.abb.de |
| DECRC/A4                                          |
| ABB Corporate Research    http://www.decrc.abb.de |
| Speyerer Strasse 4,  D-69115 Heidelberg,  Germany |
| Phone:+49-6221-596218         Fax:+49-6221-596253 |



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]