This is the mail archive of the
libc-alpha@sources.redhat.com
mailing list for the glibc project.
Re: bring mips*-linux back to a buildable state
- From: Alexandre Oliva <aoliva at redhat dot com>
- To: Andreas Jaeger <aj at suse dot de>
- Cc: libc-alpha at sources dot redhat dot com
- Date: 20 Jul 2004 06:23:24 -0300
- Subject: Re: bring mips*-linux back to a buildable state
- Organization: Red Hat Global Engineering Services Compiler Team
- References: <orfz84sk5e.fsf@livre.redhat.lsd.ic.unicamp.br><m3bribstgk.fsf@gromit.moeb>
On Jul 19, 2004, Andreas Jaeger <aj@suse.de> wrote:
> Alexandre Oliva <aoliva@redhat.com> writes:
>> These patches gets all 3 ABIs of mips64-linux to build and work again.
> Can you send them separtly, so that it's easier to comment on them?
As soon as syou get syscall-*.h to include sgidefs.h, you get a
problem at install time if sgidefs.h happens to have been installed
before: syscall-*.h is (re)built at install time, and, because of the
include flags we had, it would end up with a dependency on sgidefs.h
in the install tree. After installing the generated syscall-*.h file,
we'd install a new copy of sgidefs.h, which would get a newer
timestamp than the generated syscall-*.h, so we'd create it again,
install it again, install sgidefs.h again. Wash, rinse and repeat
indefinitely.
The fix is to make sure syscall-*.h does not get sgidefs.h from the
install tree.
While at that, I noticed other syscall-*.h rules had been updated so
as to sort the syscall names in the generated header file, so I did
the same in the mips rules.
Index: ChangeLog
from Alexandre Oliva <aoliva@redhat.com>
* sysdeps/unix/sysv/linux/mips/Makefile ($(objpfx)syscall-%.h):
Sort by syscalls. Make sure we get headers such as sgidefs.h from
the build tree before just-installed ones.
Index: sysdeps/unix/sysv/linux/mips/Makefile
===================================================================
RCS file: /cvs/cvsfiles/devo/glibc/sysdeps/unix/sysv/linux/mips/Makefile,v
retrieving revision 1.8
diff -u -p -r1.8 Makefile
--- sysdeps/unix/sysv/linux/mips/Makefile 27 Feb 2004 08:36:12 -0000 1.8
+++ sysdeps/unix/sysv/linux/mips/Makefile 2 Jul 2004 21:07:42 -0000
@@ -24,18 +24,22 @@ $(objpfx)syscall-%.h $(objpfx)syscall-%.
echo '#include <sgidefs.h>'; \
rm -f $(@:.d=.h).newt; \
$(CC) -E -MD -MP -MF $(@:.h=.d)-t -MT '$(@:.d=.h) $(@:.h=.d)' \
- -x c -I $(common-objdir) $(sysincludes) $< -D_LIBC -dM | \
+ -x c $(+includes) $(sysincludes) $< -D_LIBC -dM | \
sed -n 's@^#define __NR_\([^ ]*\) .*$$@#define SYS_\1 __NR_\1@p' \
> $(@:.d=.h).newt; \
if grep SYS_O32_ $(@:.d=.h).newt > /dev/null; then \
- echo '#if _MIPS_SIM == _MIPS_SIM_ABI64'; \
- sed -n 's/^\(#define SYS_\)N64_/\1/p' < $(@:.d=.h).newt; \
- echo '#elif _MIPS_SIM == _MIPS_SIM_NABI32'; \
- sed -n 's/^\(#define SYS_\)N32_/\1/p' < $(@:.d=.h).newt; \
+ echo '#if _MIPS_SIM == _MIPS_SIM_NABI32'; \
+ sed -n 's/^\(#define SYS_\)N32_/\1/p' < $(@:.d=.h).newt | \
+ LC_ALL=C sort; \
+ echo '#elif _MIPS_SIM == _MIPS_SIM_ABI64'; \
+ sed -n 's/^\(#define SYS_\)N64_/\1/p' < $(@:.d=.h).newt | \
+ LC_ALL=C sort; \
echo '#else'; \
- sed -n 's/^\(#define SYS_\)O32_/\1/p' < $(@:.d=.h).newt; \
+ sed -n 's/^\(#define SYS_\)O32_/\1/p' < $(@:.d=.h).newt | \
+ LC_ALL=C sort; \
echo '#endif'; \
- sed -n '/^#define SYS_\([ON]32\|N64\)_/p' < $(@:.d=.h).newt; \
+ sed -n '/^#define SYS_\([ON]32\|N64\)_/p' < $(@:.d=.h).newt | \
+ LC_ALL=C sort +1.8; \
else \
cat $(@:.d=.h).newt; \
fi; \
--
Alexandre Oliva http://www.ic.unicamp.br/~oliva/
Red Hat Compiler Engineer aoliva@{redhat.com, gcc.gnu.org}
Free Software Evangelist oliva@{lsd.ic.unicamp.br, gnu.org}