[parisc-linux] Proposed change to arch/parisc/Makefile and generation of offset.h

Randolph Chung Randolph Chung <randolph@tausq.org>
Sat, 2 Feb 2002 08:44:06 -0800


> Sounds like a reasonable compromise to me.  Only snag is that if you
> build a 32 bit kernel, make clean, change config for a 64 bit kernel,
> then make again, you will build a 64 bit kernel with the wrong offset.h.
> 
> Would be nice if 'make' could verify that the offset.h ifile was correct,
> without changing it (and so triggering dependencies).  If it could do
> that, it could regenerate it only if it was wrong.

I think it's reasonable to expect people to manually do a full 'make
dep' when switching. I'm not sure offset.h is the only thing that'll
break if they don't. 

With that said, sanity checking offset.h is never a bad thing. How about
if I also add this so that the build will complain loudly if you used
the wrong one?

Index: arch/parisc/tools/offset.c
===================================================================
RCS file: /var/cvs/linux/arch/parisc/tools/offset.c,v
retrieving revision 1.16
diff -u -p -r1.16 offset.c
--- arch/parisc/tools/offset.c	2001/10/04 11:05:47	1.16
+++ arch/parisc/tools/offset.c	2002/02/02 16:43:01
@@ -39,6 +39,15 @@ linefeed;
 text("#ifndef _PARISC_OFFSET_H");
 text("#define _PARISC_OFFSET_H");
 linefeed;
+#ifdef __LP64__
+text("#ifndef __LP64__");
+text("#error offset.h was generated for 64-bit build; did you do 'make dep'?");
+#else
+text("#ifdef __LP64__");
+text("#error offset.h was generated for 32-bit build; did you do 'make dep'?");
+#endif
+text("#endif");
+linefeed;
 
 void output_task_ptreg_defines(void)
 {



randolph
-- 
   @..@                                         http://www.TauSq.org/
  (----)
 ( >__< )
 ^^ ~~ ^^