Linux PARISC architecture development
 help / color / mirror / Atom feed
* [parisc-linux] Proposed change to arch/parisc/Makefile and generation of offset.h
@ 2002-02-02  6:34 Randolph Chung
  2002-02-02 14:07 ` Richard Hirst
  0 siblings, 1 reply; 4+ messages in thread
From: Randolph Chung @ 2002-02-02  6:34 UTC (permalink / raw)
  To: parisc-linux

I'd like to check this change in to change how we clean up and
regenerate include/asm-parisc/offset.h. This will let us ship a working
offset.h in our kernel-headers package to be used by glibc builds, and
will also allow things like gdb to build.

(basically, the problem right now is that offset.h is removed after a
'make clean')

With this change, 'make dep' will regenerate the offset.h and allow the
kernel dependency mechanism to kick in. 'make mrproper' will remove the
offset.h file, but 'make clean' will not.

comments?

randolph

Index: arch/parisc/Makefile
===================================================================
RCS file: /var/cvs/linux/arch/parisc/Makefile,v
retrieving revision 1.28
diff -u -p -r1.28 Makefile
--- arch/parisc/Makefile	2001/07/14 04:53:24	1.28
+++ arch/parisc/Makefile	2002/02/02 06:31:54
@@ -32,6 +32,7 @@ CROSS_COMPILE := hppa-linux-
 endif
 endif
 
+OFFSET_H := $(TOPDIR)/include/asm-parisc/offset.h
 FINAL_LD=$(CROSS_COMPILE)ld --warn-common --warn-section-align 
 
 CPP=$(CC) -E
@@ -79,7 +80,7 @@ SUBDIRS := $(SUBDIRS) $(addprefix arch/p
 CORE_FILES :=  $(addprefix arch/parisc/, kernel/pdc_cons.o kernel/process.o \
 	lib/lib.a mm/mm.o kernel/kernel.o hpux/hpux.o) \
 	$(CORE_FILES) arch/parisc/kernel/init_task.o
-CLEAN_FILES := $(CLEAN_FILES) arch/parisc/tools/offset.[hs] include/asm-parisc/offset.h*
+CLEAN_FILES := $(CLEAN_FILES) arch/parisc/tools/offset.[hs] 
 
 ifdef CONFIG_PARISC64
 HEAD := arch/parisc/kernel/head64.o
@@ -122,8 +123,14 @@ compressed: zImage
 
 install: 
 
+archmrproper:
+	rm -f $(OFFSET_H)
+
 archclean:
 
-archmrproper:
+archdep: $(OFFSET_H)
+
+$(OFFSET_H): include/linux/version.h
+	$(MAKE) -C $(TOPDIR)/arch/$(ARCH)/tools all
 
-archdep:
+.PHONY: archdep $(OFFSET_H)

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [parisc-linux] Proposed change to arch/parisc/Makefile and generation of offset.h
  2002-02-02  6:34 [parisc-linux] Proposed change to arch/parisc/Makefile and generation of offset.h Randolph Chung
@ 2002-02-02 14:07 ` Richard Hirst
  2002-02-02 16:44   ` Randolph Chung
  0 siblings, 1 reply; 4+ messages in thread
From: Richard Hirst @ 2002-02-02 14:07 UTC (permalink / raw)
  To: Randolph Chung; +Cc: parisc-linux

On Fri, Feb 01, 2002 at 10:34:08PM -0800, Randolph Chung wrote:
> I'd like to check this change in to change how we clean up and
> regenerate include/asm-parisc/offset.h. This will let us ship a working
> offset.h in our kernel-headers package to be used by glibc builds, and
> will also allow things like gdb to build.
> 
> (basically, the problem right now is that offset.h is removed after a
> 'make clean')
> 
> With this change, 'make dep' will regenerate the offset.h and allow the
> kernel dependency mechanism to kick in. 'make mrproper' will remove the
> offset.h file, but 'make clean' will not.
> 
> comments?

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.

Richard

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [parisc-linux] Proposed change to arch/parisc/Makefile and generation of offset.h
  2002-02-02 16:44   ` Randolph Chung
@ 2002-02-02 16:42     ` Richard Hirst
  0 siblings, 0 replies; 4+ messages in thread
From: Richard Hirst @ 2002-02-02 16:42 UTC (permalink / raw)
  To: Randolph Chung; +Cc: parisc-linux

On Sat, Feb 02, 2002 at 08:44:06AM -0800, Randolph Chung wrote:
> 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?

Looks good to me.

Richard

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [parisc-linux] Proposed change to arch/parisc/Makefile and generation of offset.h
  2002-02-02 14:07 ` Richard Hirst
@ 2002-02-02 16:44   ` Randolph Chung
  2002-02-02 16:42     ` Richard Hirst
  0 siblings, 1 reply; 4+ messages in thread
From: Randolph Chung @ 2002-02-02 16:44 UTC (permalink / raw)
  To: Richard Hirst; +Cc: parisc-linux

> 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/
  (----)
 ( >__< )
 ^^ ~~ ^^

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2002-02-02 16:53 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-02-02  6:34 [parisc-linux] Proposed change to arch/parisc/Makefile and generation of offset.h Randolph Chung
2002-02-02 14:07 ` Richard Hirst
2002-02-02 16:44   ` Randolph Chung
2002-02-02 16:42     ` Richard Hirst

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox