Skip to contentSkip to conversation

define rs_decoder.S and sm712_start.S as nodist header files

PATCH In review Andrey Borzenkov 2 participants 4 messages May 2, 2013 – May 31, 2013

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 define rs_decoder.S and sm712_start.S as nodist header files

The first fixes "make dist" on 64 bit EFI:

make[2]: Entering directory `/home/bor/build/grub/grub-core'
gcc -Wall -W -I../include -I../include -DGRUB_MACHINE_EFI=1 -DGRUB_MACHINE=X86_64_EFI -DGRUB_TARGET_CPU_X86_64=1 -m64 ... -Wtrampolines -DUSE_ASCII_FAILBACK=1 -DHAVE_UNIFONT_WIDTHSPEC=1 -Os -I.. -S -DSTANDALONE -o rs_decoder.S lib/reed_solomon.c -g0 -mregparm=3 -ffreestanding lib/reed_solomon.c:1:0: error: -mregparm is ignored in 64-bit mode [-Werror]
cc1: all warnings being treated as errors
make[2]: *** [rs_decoder.S] Error 1
make[2]: Leaving directory `/home/bor/build/grub/grub-core'
make[1]: *** [distdir] Error 1
make[1]: Leaving directory `/home/bor/build/grub'
make: *** [dist] Error 2

Add rs_decoder.S as NODIST header to kernel to avoid triggering rebuild on "make dist". As it should not be compiled on its own, but included, rename it into rs_decoder.h, so automake does the right thing.

For consistency do the same with sm712_start.S which is not required during "make dist" as well.

---
 grub-core/Makefile.am                  | 9 +++------
 grub-core/Makefile.core.def            | 2 ++
 grub-core/boot/i386/pc/startup_raw.S   | 2 +-
 grub-core/boot/mips/loongson/fwstart.S | 2 +-
 4 files changed, 7 insertions(+), 8 deletions(-)
grub-core/Makefile.am +3 -6
index fa6afcf..6d810e9 100644
@@ -45,9 +45,9 @@ gensm712: video/sm712.c
 CLEANFILES += gensm712
 
 # trigtables.c
-sm712_start.S: gensm712 video/sm712.c $(top_srcdir)/configure.ac
+sm712_start.h: gensm712 video/sm712.c $(top_srcdir)/configure.ac
 	$(builddir)/gensm712 > $@
-CLEANFILES += sm712_start.S
+CLEANFILES += sm712_start.h
 
 # XXX Use Automake's LEX & YACC support
 grub_script.tab.h: script/parser.y
@@ -60,12 +60,9 @@ grub_script.yy.h: script/yylex.l
 	$(LEX) -o grub_script.yy.c --header-file=grub_script.yy.h $<
 grub_script.yy.c: grub_script.yy.h
 
-rs_decoder.S: $(srcdir)/lib/reed_solomon.c
+rs_decoder.h: $(srcdir)/lib/reed_solomon.c
 	$(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) -Os -I$(top_builddir) -S -DSTANDALONE -o $@ $< -g0 -mregparm=3 -ffreestanding
 
-boot/i386/pc/startup_raw.S: $(builddir)/rs_decoder.S
-boot/mips/loongson/fwstart.S: $(builddir)/sm712_start.S
-
 CLEANFILES += grub_script.yy.c grub_script.yy.h
 
 include $(srcdir)/Makefile.core.am
grub-core/Makefile.core.def +2 -0
index 7e19acb..0715971 100644
@@ -396,6 +396,7 @@ image = {
 image = {
   name = lzma_decompress;
   i386_pc = boot/i386/pc/startup_raw.S;
+  i386_pc_nodist = rs_decoder.h;
 
   objcopyflags = '-O binary';
   ldflags = '$(TARGET_IMG_LDFLAGS) $(TARGET_IMG_BASE_LDOPT),0x8200';
@@ -405,6 +406,7 @@ image = {
 image = {
   name = fwstart;
   mips_loongson = boot/mips/loongson/fwstart.S;
+  mips_loongson_nodist = sm712_start.h;
   objcopyflags = '-O binary';
   ldflags = '-static-libgcc -lgcc -Wl,-N,-S,-Ttext,0xbfc00000,-Bstatic';
   enable = mips_loongson;
grub-core/boot/i386/pc/startup_raw.S +1 -1
index 81c0bc4..06dec8c 100644
@@ -119,7 +119,7 @@ LOCAL (codestart):
 
 #include "../../../kern/i386/realmode.S"
 
-#include <rs_decoder.S>
+#include <rs_decoder.h>
 
 	.text
 
grub-core/boot/mips/loongson/fwstart.S +1 -1
index ec57be6..11ad1c9 100644
@@ -886,7 +886,7 @@ table_cont:
 	b init_end
 	  nop
 init_table:	
-#include "sm712_start.S"
+#include "sm712_start.h"
 init_table_end:
 	.align 4
 init_end:	
Signature · 1 line
tg: (93daf86..) u/startup_raw_nodist (depends on: master)
#1 lore raw

grub-core/Makefile.am grub_script.yy.h: script/yylex.l · line 68

Quoted 4 lines · Andrey Borzenkov
grub-core/Makefile.am +0 -3
-boot/i386/pc/startup_raw.S: $(builddir)/rs_decoder.S
-boot/mips/loongson/fwstart.S: $(builddir)/sm712_start.S
-

Did you check that after your patch touching rs_decoder.h/sm712_start.h or their respective dependencies triggers relevant rebuild?

#2 lore raw

В Thu, 02 May 2013 14:06:40 +0200
Vladimir 'φ-coder/phcoder' Serbinenko <[email protected]> пишет:

Quoted 10 lines · Andrey Borzenkov

grub-core/Makefile.am grub_script.yy.h: script/yylex.l · line 68

Quoted 5 lines
grub-core/Makefile.am +0 -3
-boot/i386/pc/startup_raw.S: $(builddir)/rs_decoder.S
-boot/mips/loongson/fwstart.S: $(builddir)/sm712_start.S
-

Did you check that after your patch touching rs_decoder.h/sm712_start.h or their respective dependencies triggers relevant rebuild?

Yes for i386-pc. In both cases lzma_decompress.img is regenerated. I do not have MIPS environment to test, unfortunately.

#3 lore raw

В Thu, 2 May 2013 16:20:41 +0400
Andrey Borzenkov <[email protected]> пишет:

Quoted 14 lines

В Thu, 02 May 2013 14:06:40 +0200
Vladimir 'φ-coder/phcoder' Serbinenko <[email protected]> пишет:

Quoted 10 lines · Andrey Borzenkov

grub-core/Makefile.am grub_script.yy.h: script/yylex.l · line 68

Quoted 5 lines
grub-core/Makefile.am +0 -3
-boot/i386/pc/startup_raw.S: $(builddir)/rs_decoder.S
-boot/mips/loongson/fwstart.S: $(builddir)/sm712_start.S
-

Did you check that after your patch touching rs_decoder.h/sm712_start.h or their respective dependencies triggers relevant rebuild?

Quoted 2 lines

Yes for i386-pc. In both cases lzma_decompress.img is regenerated. I do not have MIPS environment to test, unfortunately.

Ping? It actually makes it impossible to run "make dist" on x86_64 platform.