Skip to contentSkip to conversation

ASFLAGS and CFLAGS

PATCH In review Hollis Blanchard 3 participants 7 messages Oct 16, 2004 – Oct 17, 2004

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ASFLAGS and CFLAGS

This patch adds -msoft-float to CFLAGS as discussed previously, and replaces -fno-builtin with -ffreestanding (which according to gcc docs implies -fno-builtin).

It also removes 2 flags from ASFLAGS that are meaningless for assembly files.

I haven't yet resolved the genmk.rb issues with listing grubof in sbin_UTILITIES. We don't want grubof to be an "IMAGE", as that does an objcopy -O binary. So I think a new class is required in genmk.rb... perhaps called pkgdata_ELF or so.

-Hollis

2004-10-15 Hollis Blanchard <[email protected]>

* conf/powerpc-ieee1275.rmk (COMMON_ASFLAGS): Remove -nostdinc and -fno-builtin.
(COMMON_CFLAGS): Remove -D__ASSEMBLY__ and -fno-builtin; add -ffreestanding and -msoft-float.

Index: conf/powerpc-ieee1275.rmk
===================================================================
RCS file: /cvsroot/grub/grub2/conf/powerpc-ieee1275.rmk,v retrieving revision 1.10

powerpc-ieee1275.rmk +2 -2
diff -u -p -r1.10 powerpc-ieee1275.rmk
@@ -1,8 +1,8 @@
 
 # -*- makefile -*-
 
-COMMON_ASFLAGS = -nostdinc -fno-builtin -D__ASSEMBLY__
-COMMON_CFLAGS = -fno-builtin -D__ASSEMBLY__
+COMMON_ASFLAGS = -D__ASSEMBLY__
+COMMON_CFLAGS = -ffreestanding -msoft-float
 
 # Images.
 
#1 lore raw
Quoted 4 lines · Hollis Blanchard

I haven't yet resolved the genmk.rb issues with listing grubof in sbin_UTILITIES. We don't want grubof to be an "IMAGE", as that does an objcopy -O binary. So I think a new class is required in genmk.rb... perhaps called pkgdata_ELF or so.

Perhaps you can prevent that when using the proper LDFLAGS for grubof only. I prefer that over what you did in this patch, if that also fixes the problem.

Thanks,
Marco

#2 lore raw
Quoted 10 lines · Marco Gerards
Quoted 4 lines · Hollis Blanchard

I haven't yet resolved the genmk.rb issues with listing grubof in sbin_UTILITIES. We don't want grubof to be an "IMAGE", as that does an objcopy -O binary. So I think a new class is required in genmk.rb... perhaps called pkgdata_ELF or so.

Perhaps you can prevent that when using the proper LDFLAGS for grubof only. I prefer that over what you did in this patch, if that also fixes the problem.

I don't understand. There are a few problems:
- -msoft-float is missing from COMMON_CFLAGS
- COMMON_ASFLAGS contains C-specific flags (-nostdinc -fno-builtin)
- COMMON_CFLAGS contains assmebly-specific flags (-D__ASSEMBLY__)

My patch addresses all three problems, with the caveat that COMMON_ASFLAGS is not actually used yet. To use COMMON_ASFLAGS, we need to fix genmk.rb. Changing LDFLAGS would have no effect on the problems listed above.

-Hollis

#3 lore raw
Quoted 9 lines · Hollis Blanchard
Quoted 7 lines · Marco Gerards
Quoted 4 lines · Hollis Blanchard

I haven't yet resolved the genmk.rb issues with listing grubof in sbin_UTILITIES. We don't want grubof to be an "IMAGE", as that does an objcopy -O binary. So I think a new class is required in genmk.rb... perhaps called pkgdata_ELF or so.

Quoted 6 lines
Quoted 3 lines

Perhaps you can prevent that when using the proper LDFLAGS for grubof only. I prefer that over what you did in this patch, if that also fixes the problem.

I don't understand. There are a few problems:
- -msoft-float is missing from COMMON_CFLAGS

I think the best thing is to add this until all code depending on this is removed.

Quoted 1 line

- COMMON_ASFLAGS contains C-specific flags (-nostdinc -fno-builtin)

This is just copied from i386-pc.rmk. I assume there was a good reason for this so I copied this. Please leave it there unless there is a good reason to remove it or Okuji says it is not required.

Quoted 1 line

- COMMON_CFLAGS contains assmebly-specific flags (-D__ASSEMBLY__)

This is a stupid copy-paste mistake from me.

Quoted 4 lines

My patch addresses all three problems, with the caveat that COMMON_ASFLAGS is not actually used yet. To use COMMON_ASFLAGS, we need to fix genmk.rb. Changing LDFLAGS would have no effect on the problems listed above.

The problem I talked about is that COMMON_ASFLAGS is not used. You are right genmk.rb might need to be fixed, I do not know. But using pkgdata_IMAGES would be the right thing to do, AFAIK. The best thing to do is fixing both issues.

Thanks,
Marco

#4 lore raw
In reply to Hollis Blanchard
Quoted 1 line · Hollis Blanchard

- COMMON_ASFLAGS contains C-specific flags (-nostdinc -fno-builtin)

-fno-builtin is meaningless, but -nostdinc is not. Note that we use cpp for assembly preprocessing.

Okuji

#5 lore raw
Quoted 5 lines · Yoshinori K. Okuji
Quoted 1 line · Hollis Blanchard

- COMMON_ASFLAGS contains C-specific flags (-nostdinc -fno-builtin)

-fno-builtin is meaningless, but -nostdinc is not. Note that we use cpp for assembly preprocessing.

Do you use "#include <file-living-in-/usr/include>" in an assembly file?

-Hollis

#6 lore raw
Quoted 2 lines · Hollis Blanchard

Do you use "#include <file-living-in-/usr/include>" in an assembly file?

No, but I don't understand your question. If I use "#include <foo.h>", gcc tries to find foo.h from standard locations first, unless -nostdinc is used.

Okuji