Skip to contentSkip to conversation

porting to hppa-ipl

DISCUSSION Jeff Bailey 2 participants 7 messages Jul 29, 2006 – Jul 31, 2006

lore
Share & tools
lore
#0 lore raw

Hi! I started working on the port to hppa-ipl and have run into three things:

1) Dependancy generation seems to skip out on files that don't exist. This means that in the Makefile, hello.c doesn't wind up depending on grub_script.tab.h. "make grub_script.tab.h" works fine, and then the build can proceed. Current ports work around this by defining _HEADERS lines, apparently, but this dependancy should probalby be explicitely declared somewhere, or this file should be forcibly generated.

2) When hacking on the build env, how do I force things to be regenerated? When I do "make conf/hppa-ipl.mk", it doesn't generate the file for me.

3) The files for grub-emu and others seems to be copied into each file in conf. Should these be refactored out into common.mk? It seems a waste for me to just copy them into hppa-ipl for yet another time.

Tks,
Jeff Bailey

Signature · 3 lines
I do not agree with a word you say, but I will defend to the death your
right to say it. 
 - Voltaire
#1 lore raw
Quoted 2 lines · Jeff Bailey

Hi! I started working on the port to hppa-ipl and have run into three things:

Amazing. ;)

Quoted 6 lines

1) Dependancy generation seems to skip out on files that don't exist. This means that in the Makefile, hello.c doesn't wind up depending on grub_script.tab.h. "make grub_script.tab.h" works fine, and then the build can proceed. Current ports work around this by defining _HEADERS lines, apparently, but this dependancy should probalby be explicitely declared somewhere, or this file should be forcibly generated.

Why does hello.c depend on grub_script.tab.h? AFAIK, only normal/lexer.c depends on grub_script.tab.h, and the dependency is automatically generated in my environment.

Quoted 3 lines

2) When hacking on the build env, how do I force things to be regenerated? When I do "make conf/hppa-ipl.mk", it doesn't generate the file for me.

Isn't it normal in make??? When I play with make, I do "rm -f FILE; make FILE". I don't know anything else more elegant.

Quoted 3 lines

3) The files for grub-emu and others seems to be copied into each file in conf. Should these be refactored out into common.mk? It seems a waste for me to just copy them into hppa-ipl for yet another time.

Well, the original idea I had was that it could be possible to implement grub-emu differently among architectures. Currently we only emulate PC. I cannot tell you if this is a good thing. As grub-emu does not use much in i386- or PC-specific code, this might be sufficient. If so, it is a good idea to share the same config in common.rmk.

Okuji

#2 lore raw
Quoted 5 lines · Yoshinori K. Okuji
Quoted 2 lines · Jeff Bailey

Hi! I started working on the port to hppa-ipl and have run into three things:

Amazing. ;)

*lol* It's amazing when I'm succesful, in the meantime, it's just insane. =)

One of the nice things, though, is that I have the support of the folks who wrote palo.

Quoted 10 lines
Quoted 6 lines

1) Dependancy generation seems to skip out on files that don't exist. This means that in the Makefile, hello.c doesn't wind up depending on grub_script.tab.h. "make grub_script.tab.h" works fine, and then the build can proceed. Current ports work around this by defining _HEADERS lines, apparently, but this dependancy should probalby be explicitely declared somewhere, or this file should be forcibly generated.

Why does hello.c depend on grub_script.tab.h? AFAIK, only normal/lexer.c depends on grub_script.tab.h, and the dependency is automatically generated in my environment.

According to GCC:

gcc -Ihello -I./hello -I. -Iinclude -I./include -Wall -W -Wall -W -Wshadow -Wpointer-arith -Wmissing-prototypes -Wundef -Wstrict-prototypes -g -Os -fno-builtin -c -o hello_mod-hello_hello.o hello/hello.c
In file included from include/grub/normal.h:28,

                 from hello/hello.c:27:

include/grub/script.h:27:29: error: grub_script.tab.h: No such file or directory

Quoted 6 lines
Quoted 3 lines

2) When hacking on the build env, how do I force things to be regenerated? When I do "make conf/hppa-ipl.mk", it doesn't generate the file for me.

Isn't it normal in make??? When I play with make, I do "rm -f FILE; make FILE". I don't know anything else more elegant.

Right it is normal in make, which is why I was surprised it didn't work:

jbailey@test148:~/Programming/cvstree/grub2/conf$ rm hppa-ipl.mk
jbailey@test148:~/Programming/cvstree/grub2/conf$ cd ..
jbailey@test148:~/Programming/cvstree/grub2$ make conf/hppa-ipl.mk
Makefile:105: conf/hppa-ipl.mk: No such file or directory
make: *** No rule to make target `conf/hppa-ipl.mk'.  Stop.
jbailey@test148:~/Programming/cvstree/grub2$ cd conf
jbailey@test148:~/Programming/cvstree/grub2/conf$ make hppa-ipl.mk
make: *** No rule to make target `hppa-ipl.mk'.  Stop.
jbailey@test148:~/Programming/cvstree/grub2/conf$ ls hppa-ipl.rmk
hppa-ipl.rmk
jbailey@test148:~/Programming/cvstree/grub2/conf$ 
Quoted 9 lines
Quoted 3 lines

3) The files for grub-emu and others seems to be copied into each file in conf. Should these be refactored out into common.mk? It seems a waste for me to just copy them into hppa-ipl for yet another time.

Well, the original idea I had was that it could be possible to implement grub-emu differently among architectures. Currently we only emulate PC. I cannot tell you if this is a good thing. As grub-emu does not use much in i386- or PC-specific code, this might be sufficient. If so, it is a good idea to share the same config in common.rmk.

Okay. As I'm hacking along, I'll see what I do that looks identical and supply patches to refactor.

Tks,
Jeff Bailey

Signature · 3 lines
I do not agree with a word you say, but I will defend to the death your
right to say it. 
 - Voltaire
#3 lore raw
Quoted 2 lines · Jeff Bailey

One of the nice things, though, is that I have the support of the folks who wrote palo.

Great. :)

Quoted 9 lines

According to GCC:

gcc -Ihello -I./hello -I. -Iinclude -I./include -Wall -W -Wall -W -Wshadow

(quoted diff) +0 -2
-Wpointer-arith -Wmissing-prototypes                  -Wundef
-Wstrict-prototypes -g -Os -fno-builtin  -c -o hello_mod-hello_hello.o

hello/hello.c In file included from include/grub/normal.h:28,

                 from hello/hello.c:27:

include/grub/script.h:27:29: error: grub_script.tab.h: No such file or directory

Right. But I have this dependency generated automatically as well:

hello_mod-hello_hello.o
hello_mod-hello_hello.d : ../hello/hello.c ../include/grub/types.h config.h \
include/grub/cpu/types.h ../include/grub/misc.h \
/usr/lib/gcc/i586-mandriva-linux-gnu/4.0.1/include/stdarg.h \
../include/grub/symbol.h ../include/grub/err.h ../include/grub/mm.h \
../include/grub/dl.h ../include/grub/normal.h ../include/grub/setjmp.h \
include/grub/cpu/setjmp.h ../include/grub/arg.h \
../include/grub/script.h ../include/grub/parser.h grub_script.tab.h

So the question is why you don't have it. Please look at the content of hello_mod-hello_hello.d.

Quoted 9 lines
Quoted 6 lines
Quoted 3 lines

2) When hacking on the build env, how do I force things to be regenerated? When I do "make conf/hppa-ipl.mk", it doesn't generate the file for me.

Isn't it normal in make??? When I play with make, I do "rm -f FILE; make FILE". I don't know anything else more elegant.

Right it is normal in make, which is why I was surprised it didn't work:

Quoted 11 lines
jbailey@test148:~/Programming/cvstree/grub2/conf$ rm hppa-ipl.mk
jbailey@test148:~/Programming/cvstree/grub2/conf$ cd ..
jbailey@test148:~/Programming/cvstree/grub2$ make conf/hppa-ipl.mk
Makefile:105: conf/hppa-ipl.mk: No such file or directory
make: *** No rule to make target `conf/hppa-ipl.mk'.  Stop.
jbailey@test148:~/Programming/cvstree/grub2$ cd conf
jbailey@test148:~/Programming/cvstree/grub2/conf$ make hppa-ipl.mk
make: *** No rule to make target `hppa-ipl.mk'.  Stop.
jbailey@test148:~/Programming/cvstree/grub2/conf$ ls hppa-ipl.rmk
hppa-ipl.rmk
jbailey@test148:~/Programming/cvstree/grub2/conf$

Since it works for me, all I can say is "I don't know". Have you added hppa-ipl.rmk into RMKFILES in Makefile.in?

Okuji

#4 lore raw
Quoted 21 lines · Yoshinori K. Okuji
Quoted 9 lines

According to GCC:

gcc -Ihello -I./hello -I. -Iinclude -I./include -Wall -W -Wall -W -Wshadow

(quoted diff) +0 -2
-Wpointer-arith -Wmissing-prototypes                  -Wundef
-Wstrict-prototypes -g -Os -fno-builtin  -c -o hello_mod-hello_hello.o

hello/hello.c In file included from include/grub/normal.h:28,

                 from hello/hello.c:27:

include/grub/script.h:27:29: error: grub_script.tab.h: No such file or directory

Right. But I have this dependency generated automatically as well:

hello_mod-hello_hello.o
hello_mod-hello_hello.d : ../hello/hello.c ../include/grub/types.h config.h \
include/grub/cpu/types.h ../include/grub/misc.h \
/usr/lib/gcc/i586-mandriva-linux-gnu/4.0.1/include/stdarg.h \
../include/grub/symbol.h ../include/grub/err.h ../include/grub/mm.h \
../include/grub/dl.h ../include/grub/normal.h ../include/grub/setjmp.h \
include/grub/cpu/setjmp.h ../include/grub/arg.h \
../include/grub/script.h ../include/grub/parser.h grub_script.tab.h

Quoted 2 lines

So the question is why you don't have it. Please look at the content of hello_mod-hello_hello.d.

set -e; gcc -Ihello -I./hello -I. -Iinclude -I./include -Wall -W -Wall -W -Wshadow -Wpointer-arith -Wmissing-prototypes -Wundef -Wstrict-prototypes -g -Os -fno-builtin -M hello/hello.c | sed 's,hello\.o[ :]*,hello_mod-hello_hello.o hello_mod-hello_hello.d : ,g' > hello_mod-hello_hello.d; [ -s hello_mod-hello_hello.d ] || rm -f hello_mod-hello_hello.d
In file included from include/grub/normal.h:28,

                 from hello/hello.c:27:

include/grub/script.h:27:29: error: grub_script.tab.h: No such file or directory

Generates a zero-byte file which is promptly deleted. So this file is never generated.

Quoted 6 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

2) When hacking on the build env, how do I force things to be regenerated? When I do "make conf/hppa-ipl.mk", it doesn't generate the file for me.

Since it works for me, all I can say is "I don't know". Have you added hppa-ipl.rmk into RMKFILES in Makefile.in?

Oh. I see. I had misunderstood the rule:
$(addprefix $(srcdir)/,$(MKFILES)): %.mk: %.rmk genmk.rb

as being a generic rule. I'll try to send a patch for that as well. Adding it to RMKFILES also helped.

Do you accept GNU make-isms, or are you restricting yourself to POSIX make?

Tks,
Jeff Bailey

Signature · 3 lines
I do not agree with a word you say, but I will defend to the death your
right to say it. 
 - Voltaire
#5 lore raw
Quoted 4 lines · Jeff Bailey

set -e; gcc -Ihello -I./hello -I. -Iinclude -I./include -Wall -W

(quoted diff) +0 -2
-Wall -W -Wshadow -Wpointer-arith -Wmissing-prototypes                 
-Wundef -Wstrict-prototypes -g -Os -fno-builtin  -M hello/hello.c      |

sed 's,hello\.o[ :]*,hello_mod-hello_hello.o hello_mod-hello_hello.d : ,g'

Quoted 8 lines
Quoted 1 line

hello_mod-hello_hello.d; [ -s hello_mod-hello_hello.d ] || rm -f

hello_mod-hello_hello.d In file included from include/grub/normal.h:28,

                 from hello/hello.c:27:

include/grub/script.h:27:29: error: grub_script.tab.h: No such file or directory

Generates a zero-byte file which is promptly deleted. So this file is never generated.

I took a look at the log. It says that the dependency generation fails at the first time, as grub_script.tab.h does not exist, but it is performed again after grub_script.tab.h is generated. Doesn't this happen in your environment?

Quoted 2 lines

Do you accept GNU make-isms, or are you restricting yourself to POSIX make?

We use GNU make, no problem.

Okuji

#6 lore raw
Quoted 11 lines · Yoshinori K. Okuji
Quoted 10 lines · Jeff Bailey

set -e; gcc -Ihello -I./hello -I. -Iinclude -I./include -Wall -W

(quoted diff) +0 -2
-Wall -W -Wshadow -Wpointer-arith -Wmissing-prototypes                 
-Wundef -Wstrict-prototypes -g -Os -fno-builtin  -M hello/hello.c      |

sed 's,hello\.o[ :]*,hello_mod-hello_hello.o hello_mod-hello_hello.d : ,g'

Quoted 1 line

hello_mod-hello_hello.d; [ -s hello_mod-hello_hello.d ] || rm -f

hello_mod-hello_hello.d In file included from include/grub/normal.h:28,

                 from hello/hello.c:27:

include/grub/script.h:27:29: error: grub_script.tab.h: No such file or directory

Quoted 7 lines
Quoted 2 lines

Generates a zero-byte file which is promptly deleted. So this file is never generated.

I took a look at the log. It says that the dependency generation fails at the first time, as grub_script.tab.h does not exist, but it is performed again after grub_script.tab.h is generated. Doesn't this happen in your environment?

Nope, grub_script.tab.h is never generated on my system. It looks like on other arch's it's generated as a side effect of programs defined in conf/*. Because I'm still trying to get the base set of things built, the missing dependancy causes me grief. That's why I think it needs an added dependancy.

Tks,
Jeff Bailey

Signature · 3 lines
I do not agree with a word you say, but I will defend to the death your
right to say it. 
 - Voltaire