Date: Sun, 25 Nov 2001 21:22:59 +0200 From: "Eli Zaretskii" Sender: halo1 AT zahav DOT net DOT il To: Richard Dawe Message-Id: <1858-Sun25Nov2001212259+0200-eliz@is.elta.co.il> X-Mailer: emacs 21.1.50 (via feedmail 8 I) and Blat ver 1.8.9 CC: djgpp-workers AT delorie DOT com In-reply-to: <3C013F37.F451C083@phekda.freeserve.co.uk> (message from Richard Dawe on Sun, 25 Nov 2001 18:57:59 +0000) Subject: Re: Building a profiled version of libc References: <3BF97E29 DOT 39FC7C7E AT phekda DOT freeserve DOT co DOT uk> <3405-Tue20Nov2001082315+0200-eliz AT is DOT elta DOT co DOT il> <3C00F797 DOT 88E8AA45 AT phekda DOT freeserve DOT co DOT uk> <7263-Sun25Nov2001182924+0200-eliz AT is DOT elta DOT co DOT il> <3C013F37 DOT F451C083 AT phekda DOT freeserve DOT co DOT uk> Reply-To: djgpp-workers AT delorie DOT com Errors-To: nobody AT delorie DOT com X-Mailing-List: djgpp-workers AT delorie DOT com X-Unsubscribes-To: listserv AT delorie DOT com Precedence: bulk > Date: Sun, 25 Nov 2001 18:57:59 +0000 > From: Richard Dawe > > ./../../hostbin/dxegen.exe ./../../bin/emu387.dxe __emu_entry src/emu387.o > id_emu.o src/emudummy.o -L../../lib c:/djgpp/lib/gcc-lib/djgpp/3.02/libgcc.a > -lc c:/djgpp/lib/gcc-lib/djgpp/3.02/libgcc.a > ld -X -S -r -o dxe__tmp.o -L./../../lib src/emu387.o id_emu.o > src/emudummy.o -L../../lib c:/djgpp/lib/gcc-lib/djgpp/3.02/libgcc.a -lc > c:/djgpp/lib/gcc-lib/djgpp/3.02/libgcc.a -T dxe.ld > ./../../lib/libc.a(_write.o)(.text+0x0):_write.c: multiple definition of > `_write' > src/emudummy.o(.text+0x10):emudummy.c: first defined here > make.exe: *** [../../bin/emu387.dxe] Error 1 Does it help to make src/emudummy.o be the first object file in the link command line, before dxe__tmp.o and emu387.o? I think the problem is that some of the other object files calls _write (indirectly) because of the -pg used to compile library functions. By the time the linker sees emudummy.o, it has already pulled in _write from libc.a, so it barfs. If you force it to use the definitions from emudummy.o, it will never need the one from libc.a.