Re: [PATCH] Fix Immediate Values x86_64 support old gcc



On Wed, May 21, 2008 at 05:28:09PM -0400, Mathieu Desnoyers wrote:
* Sam Ravnborg (sam@xxxxxxxxxxxx) wrote:
Hi Mathieu
Does this fix make more sense ?

GCC < 4, on x86_64, does not accept symbol+offset operands for "i" constraints
asm statements. Fallback on generic immediate values if this compiler is
detected.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@xxxxxxxxxx>
---
arch/x86/Makefile | 3 +++
arch/x86/kernel/Makefile | 4 +++-
include/asm-x86/immediate.h | 5 +++++
include/linux/immediate.h | 4 +++-
kernel/Makefile | 4 +++-
5 files changed, 17 insertions(+), 3 deletions(-)

Index: linux-2.6-sched-devel/arch/x86/Makefile
===================================================================
--- linux-2.6-sched-devel.orig/arch/x86/Makefile 2008-05-21 09:04:52.000000000 -0400
+++ linux-2.6-sched-devel/arch/x86/Makefile 2008-05-21 09:22:05.000000000 -0400
@@ -78,6 +78,9 @@
"$(CC)" -fstack-protector-all )

KBUILD_CFLAGS += $(stackp-y)
+
+ export GCC_BROKEN_IMMEDIATE
+ GCC_BROKEN_IMMEDIATE := $(shell if [ $(call cc-version) -lt 0400 ] ; then echo "y"; fi)

So here we introduce a global environment variable that tells
us that gcc has "BROKEN_IMMEDIATE".
I have absolutely no clue what "BROKEN_IMMEDIATE" is so I guess others
are in the same boat. Comment please!


Yes, I guess this worth being commented, you are right. I'll write
something along the lines written in the patch header.

Consider something like this (note: no negative logic involved):
export USE_IMMEDIATE := $(call cc-ifversion, -ge, 0400, $(CONFIG_IMMEDIATE))


Hrm, if I do that, I would have to add USE_IMMEDIATE to each
architecture's makefiles for which immediate values are supported, e.g.:

export USE_IMMEDIATE := $(CONFIG_IMMEDIATE)

The "BROKEN_IMMEDIATE" (negative) approach only needs to be defined on
x86_64 where gcc 3.x does not support symbol+offset correctly.
Same with USE_IMMEDIATE - as USE_IMMEDIATE is only used in a x86 Makefile.
Or did I miss sothing?

Sam
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/



Relevant Pages

  • Re: Whats the story with the "end of XP"?
    ... Support gives them access to the larger body ... The same compiler suite may be "best" in both ... In the case of ByteCraft compilers, you are truly expert in your field, you work closely and rapidly with customers if there are any issues, and you have top class testing and quality control. ... understanding the inner workings of a relatively simple compiler like GCC ...
    (comp.arch.embedded)
  • Re: Idea: Multitasking graphical OS for the GS
    ... IIgs 65816 compiler that has nearly the number of ... gcc also has a much larger support infrastructure where it will be easier to ... The software developer and the hardware ...
    (comp.sys.apple2)
  • Re: Non ASCII characters in CFString litteral, HELP !
    ... CodeWarrior is PPC-only and very dead, ... compilers listed don't even support Objective-C. ... It is indeed lamentable that we have pretty much only one compiler ... For this particular case, blame C or Cocoa, not gcc. ...
    (comp.sys.mac.programmer.help)
  • Re: Compiling Tcl with Msys/MinGW on Windows XP
    ... checking for gcc... ... checking whether the C compiler is a cross-compiler... ... checking for EXCEPTION_DISPOSITION support in include files... ... I saw one case were people had to use msys 1.0.6 ...
    (comp.lang.tcl)
  • Re: RFC: drop support for gcc < 4.0
    ... gcc 3.2, but works when compiled with gcc 4.2" will most likely be lost ... use gcc-3 as the default kernel compiler will take it seriously (if it ... looks to have an impact to our kernel builds) otherwise we can tell you ... badly broken" would be "only support what the GCC team supports", ...
    (Linux-Kernel)