Hi,
I have an obscure little error that kept me from running Genode with base-foc. I have a freshly cloned Genode repo on the master branch with a freshly 'make prepare'd base-foc/contrib. The build dir is also freshly created and not modified (no 'MAKE+=j' or something). I'm using Linux 3.0.0-23 x86_64 and GCC 4.7.2 and i already built with FOC on GCC 4.6.x some time ago. The error:
[ "222" -lt "218" ] && \ CPP_ARGS="-DMAXPAGESIZE=0x1000 -DCOMMONPAGESIZE=0x1000 -DCONSTANT(x)=x"; \ cpp -nostdinc -include /home/hyronimo/LokaleDaten1/GenodeLabs/genode/test/base-foc/contrib/l4/pkg/ldscripts/generic.h \ -Wno-trigraphs -Ui386 -P $CPP_ARGS /home/hyronimo/LokaleDaten1/GenodeLabs/genode/test/base-foc/contrib/l4/pkg/ldscripts/ARCH-arm/main_dyn.ld main_dyn.ld cc1: error: missing argument to "-P"
led me to 'base-foc/contrib/l4/pkg/ldscripts/Makefile' where
%.ld: $(PKGDIR)/ARCH-$(ARCH)/%.ld $(SRC_DIR)/Makefile $(SRC_DIR)/generic.h -@$(GEN_MESSAGE) $(VERBOSE)[ "$(LDVERSION)" -lt "218" ] && \ CPP_ARGS="-DMAXPAGESIZE=$(MAXPAGESIZE_$(ARCH)) -DCOMMONPAGESIZE=$(COMMONPAGESIZE_$(ARCH)) -DCONSTANT(x)=x"; \ cpp -nostdinc -include $(SRC_DIR)/generic.h \ -Wno-trigraphs -Ui386 -P $$CPP_ARGS $< $@
checks the LD version that is 222 and not 218 in my scenario, thus CPP_ARGS is empty. But even with a not empty CPP_ARGS i get the error. Thus i removed anything before the cpp-call and inserted the CPP_ARGS directly, one times with the 222-version and another with the 218 version.
Now the build was going on until this came up:
/usr/local/genode-gcc/bin/genode-arm-ld:/home/hyronimo/LokaleDaten1/GenodeLabs/genode/build.test/l4/lib/arm_armv7a/main_rel.ld:1: ignoring invalid character `#' in expression /usr/local/genode-gcc/bin/genode-arm-ld:/home/hyronimo/LokaleDaten1/GenodeLabs/genode/build.test/l4/lib/arm_armv7a/main_rel.ld:1: syntax error
that was caused by comments that were preceeded by '#' instead of '/*', thus i removed all of these faulty comments and now the demo builds and runs fine.
I'm a little confused with this, has anybody a hint for me?
A similar problem occurs when building on fiasco:
The error
Program bootstrap/bootstrap make[6]: Nothing to be done for `all'. ... Generating bootstrap.ld cc1: error: missing argument to "-P"
is caused by the '-P' in
$(LDSCRIPT): $(LDSCRIPT).in $(SRC_DIR)/Makefile $(BOOTSTRAP_LD_dep) @$(GEN_MESSAGE) $(VERBOSE)cpp -P $(CPPFLAGS) -DLINKADDR=$(DEFAULT_RELOC_$(ARCH)) $< $@;
in
base-fiasco/contrib/fiasco/snapshot/l4/pkg/bootstrap/server/src/Makefile
and can be solved by using '-P="$(CPPFLAGS)"' then the error
/usr/local/genode-gcc/bin/genode-x86-ld:bootstrap.ld:1: ignoring invalid character `#' in expression /usr/local/genode-gcc/bin/genode-x86-ld:bootstrap.ld:1: syntax error
leds to <BUILD_DIR>/l4/pkg/bootstrap/server/src/OBJ-x86_586/bootstrap.ld where removing the faulty comment style is again the problem.
After this the build and run succeeds. The problems do not occur with other L4 based kernels.
On 11/12/2012 11:39 AM, Martin Stein wrote:
Hi,
I have an obscure little error that kept me from running Genode with base-foc. I have a freshly cloned Genode repo on the master branch with a freshly 'make prepare'd base-foc/contrib. The build dir is also freshly created and not modified (no 'MAKE+=j' or something). I'm using Linux 3.0.0-23 x86_64 and GCC 4.7.2 and i already built with FOC on GCC 4.6.x some time ago. The error:
[ "222" -lt "218" ] && \ CPP_ARGS="-DMAXPAGESIZE=0x1000 -DCOMMONPAGESIZE=0x1000 -DCONSTANT(x)=x"; \ cpp -nostdinc -include /home/hyronimo/LokaleDaten1/GenodeLabs/genode/test/base-foc/contrib/l4/pkg/ldscripts/generic.h \ -Wno-trigraphs -Ui386 -P $CPP_ARGS /home/hyronimo/LokaleDaten1/GenodeLabs/genode/test/base-foc/contrib/l4/pkg/ldscripts/ARCH-arm/main_dyn.ld main_dyn.ld cc1: error: missing argument to "-P"
led me to 'base-foc/contrib/l4/pkg/ldscripts/Makefile' where
%.ld: $(PKGDIR)/ARCH-$(ARCH)/%.ld $(SRC_DIR)/Makefile $(SRC_DIR)/generic.h -@$(GEN_MESSAGE) $(VERBOSE)[ "$(LDVERSION)" -lt "218" ] && \ CPP_ARGS="-DMAXPAGESIZE=$(MAXPAGESIZE_$(ARCH)) -DCOMMONPAGESIZE=$(COMMONPAGESIZE_$(ARCH)) -DCONSTANT(x)=x"; \ cpp -nostdinc -include $(SRC_DIR)/generic.h \ -Wno-trigraphs -Ui386 -P $$CPP_ARGS $< $@
checks the LD version that is 222 and not 218 in my scenario, thus CPP_ARGS is empty. But even with a not empty CPP_ARGS i get the error. Thus i removed anything before the cpp-call and inserted the CPP_ARGS directly, one times with the 222-version and another with the 218 version.
Now the build was going on until this came up:
/usr/local/genode-gcc/bin/genode-arm-ld:/home/hyronimo/LokaleDaten1/GenodeLabs/genode/build.test/l4/lib/arm_armv7a/main_rel.ld:1: ignoring invalid character `#' in expression /usr/local/genode-gcc/bin/genode-arm-ld:/home/hyronimo/LokaleDaten1/GenodeLabs/genode/build.test/l4/lib/arm_armv7a/main_rel.ld:1: syntax error
that was caused by comments that were preceeded by '#' instead of '/*', thus i removed all of these faulty comments and now the demo builds and runs fine.
I'm a little confused with this, has anybody a hint for me?
Hi Martin,
On Tue, Nov 13, 2012 at 01:51:07PM +0100, Martin Stein wrote:
A similar problem occurs when building on fiasco:
The error
Program bootstrap/bootstrap make[6]: Nothing to be done for `all'. ... Generating bootstrap.ld cc1: error: missing argument to "-P"
is caused by the '-P' in
$(LDSCRIPT): $(LDSCRIPT).in $(SRC_DIR)/Makefile $(BOOTSTRAP_LD_dep) @$(GEN_MESSAGE) $(VERBOSE)cpp -P $(CPPFLAGS) -DLINKADDR=$(DEFAULT_RELOC_$(ARCH)) $< $@;
in
base-fiasco/contrib/fiasco/snapshot/l4/pkg/bootstrap/server/src/Makefile
and can be solved by using '-P="$(CPPFLAGS)"'
If I read the manpage correctly '-P' does not need arguments. A quick test
touch /tmp/c.c /usr/local/genode-gcc/bin/genode-arm-cpp -P -DFOOBAR /tmp/c.c /tmp/c.E
also worked without problems.
Did I miss something?
Yes i was also confused, i found the mentioned solution only through try and error... I also don't find much informations about 'cc1'.
On 11/13/2012 06:17 PM, Christian Helmuth wrote:
Hi Martin,
On Tue, Nov 13, 2012 at 01:51:07PM +0100, Martin Stein wrote:
A similar problem occurs when building on fiasco:
The error
Program bootstrap/bootstrap make[6]: Nothing to be done for `all'. ... Generating bootstrap.ld cc1: error: missing argument to "-P"
is caused by the '-P' in
$(LDSCRIPT): $(LDSCRIPT).in $(SRC_DIR)/Makefile $(BOOTSTRAP_LD_dep) @$(GEN_MESSAGE) $(VERBOSE)cpp -P $(CPPFLAGS) -DLINKADDR=$(DEFAULT_RELOC_$(ARCH)) $< $@;
in
base-fiasco/contrib/fiasco/snapshot/l4/pkg/bootstrap/server/src/Makefile
and can be solved by using '-P="$(CPPFLAGS)"'
If I read the manpage correctly '-P' does not need arguments. A quick test
touch /tmp/c.c /usr/local/genode-gcc/bin/genode-arm-cpp -P -DFOOBAR /tmp/c.c /tmp/c.E
also worked without problems.
Did I miss something?
Hej,
On Tue, Nov 13, 2012 at 07:30:50PM +0100, Martin Stein wrote:
Yes i was also confused, i found the mentioned solution only through try and error... I also don't find much informations about 'cc1'.
Actually, cc1 should be invocation-compatible with gcc. I tried
/usr/local/genode-gcc/libexec/gcc/x86_64-elf/4.7.2/cc1 --help | grep -C 2 "-P"
which produced
-MQ <target> -MT <target> -P -U<macro> -Wabi [disabled]
Maybe you could sneak in 'strace -f -o /tmp/l' in the make recipe to get a log of what really happens. Please lookout for 'execve'.
Regards
Hello,
please let me self-reply as Martin and me found out what went wrong on his machine...
On Tue, Nov 13, 2012 at 08:14:09PM +0100, Christian Helmuth wrote:
Maybe you could sneak in 'strace -f -o /tmp/l' in the make recipe to get a log of what really happens. Please lookout for 'execve'.
We did a quick 'which cpp', which lead us to '/usr/local/bin/cpp'. This binary belonged to a rather old version (4.3.x) of the GCC tool chain, which did not recognize the parameters (esp. -P) correctly. The follow up question is: Why does the build system end up in /usr/local/bin though we configured the Genode tool chain correctly?
The reason lies in the mentioned Makefile for the third-party bootstrap component. I opened a bug report at
https://github.com/genodelabs/genode/issues/490
Greets