Fix 64-bit foreign header check
PATCH 1/1 Fix 64-bit foreign header check
# HG changeset patch
# User [email protected]
# Date 1187187471 25200
# Node ID ce1e8719a4d8c2d9051e60e14213550ba0eb3809 # Parent 3177ef0cc3ecc27051af5b3cbba72b3e42a26b68 Fix 64-bit foreign header check
If a 64-bit build is chosen, we need to compile the checker program with -m64. Use CFLAGS instead of HOSTCFLAGS (this check doesn't work under a cross-compile anyway).
xen/include/public/foreign/Makefile +1 -1
@@ -18,7 +18,7 @@ check-headers: checker ./checker > $(XEN_TARGET_ARCH).size diff -u reference.size $(XEN_TARGET_ARCH).size checker: checker.c $(headers) - $(HOSTCC) $(HOSTCFLAGS) -o $@ $< + $(CC) $(CFLAGS) -o $@ $< else check-headers: @echo "cross build: skipping check"
Quoted 5 lines · On 15/8/07 15:20, "[email protected]" <[email protected]> wrote:
Fix 64-bit foreign header check
If a 64-bit build is chosen, we need to compile the checker program with -m64. Use CFLAGS instead of HOSTCFLAGS (this check doesn't work under a cross-compile anyway).
Won't gcc produce 64-bit binaries by default in a 64-bit environment? Which must be the case if you have TARGET_ARCH==COMPILE_ARCH, and the target arch is 64-bit.
-- Keir
Quoted 7 lines · Keir Fraser
Quoted 5 lines
Fix 64-bit foreign header check
If a 64-bit build is chosen, we need to compile the checker program with -m64. Use CFLAGS instead of HOSTCFLAGS (this check doesn't work under a cross-compile anyway).
Won't gcc produce 64-bit binaries by default in a 64-bit environment?
There is no such thing as a "64-bit environment" on Solaris, all machines ship with both 32 and 64 bit functionality (of course the kernel must be 64-bit to actually /use/ such).
Thus we build twice, once in 32-bit, once in 64-bit.
regards,
john
Quoted 7 lines · John Levon
Quoted 1 line
Won't gcc produce 64-bit binaries by default in a 64-bit environment?
There is no such thing as a "64-bit environment" on Solaris, all machines ship with both 32 and 64 bit functionality (of course the kernel must be 64-bit to actually /use/ such).
Thus we build twice, once in 32-bit, once in 64-bit.
Then isn't your TARGET_ARCH!=COMPILE_ARCH for one of these builds? Sounds like you have a 32-bit-ish compile environment (since you produce 32-bit binaries by default), and hence it would be correct to have COMPILE_ARCH==x86_32 for both builds.
-- Keir
Quoted 6 lines · Keir Fraser
Quoted 6 lines
Quoted 1 line
Won't gcc produce 64-bit binaries by default in a 64-bit environment?
There is no such thing as a "64-bit environment" on Solaris, all machines ship with both 32 and 64 bit functionality (of course the kernel must be 64-bit to actually /use/ such).
Quoted 6 lines
Quoted 1 line
Thus we build twice, once in 32-bit, once in 64-bit.
Then isn't your TARGET_ARCH!=COMPILE_ARCH for one of these builds? Sounds like you have a 32-bit-ish compile environment (since you produce 32-bit binaries by default), and hence it would be correct to have COMPILE_ARCH==x86_32 for both builds.
There is no such "32-bit" environment, we can always produce both. What you're suggesting sounds like a cross-compile. This is absolutely not a cross compile; in particular we can and do want this header check to happen.
We set XEN_COMPILE_ARCH by hand to 64-bit since the Xen makefiles have the notion that uname has anything to do with 32 or 64 bitness (a Linux-ism; in fact an x86_64-Linux-ism, since I believe other Linux arches do it the traditional way).
regards
john
Quoted 11 lines · John Levon
There is no such "32-bit" environment, we can always produce both. What you're
suggesting sounds like a cross-compile. This is absolutely not a cross compile;
in particular we can and do want this header check to happen.We set
XEN_COMPILE_ARCHby hand to 64-bit since the Xen makefiles have the notion
that uname has anything to do with 32 or 64 bitness (a Linux-ism; in fact an x86_64-Linux-ism, since I believe other Linux arches do it the traditional way).
Hmmm... Well varying COMPILE_ARCH when the compile arch is not actually changing seems dodgy to me.
In any case, binaries that run on the compile host should build with HOSTCC/HOSTCFLAGS. That seems a pretty simple and obvious rule that I do not want to introduce exceptions to.
-- Keir
Quoted 12 lines · Keir Fraser
Quoted 11 lines
There is no such "32-bit" environment, we can always produce both. What you're
suggesting sounds like a cross-compile. This is absolutely not a cross compile;
in particular we can and do want this header check to happen.We set
XEN_COMPILE_ARCHby hand to 64-bit since the Xen makefiles have the notion
that uname has anything to do with 32 or 64 bitness (a Linux-ism; in fact an x86_64-Linux-ism, since I believe other Linux arches do it the traditional way).
Quoted 6 lines
Hmmm... Well varying
COMPILE_ARCHwhen the compile arch is not actually changing seems dodgy to me.In any case, binaries that run on the compile host should build with HOSTCC/HOSTCFLAGS. That seems a pretty simple and obvious rule that I do not want to introduce exceptions to.
Can you please explain what you want us to do.
john
Quoted 8 lines · John Levon
Quoted 6 lines
Hmmm... Well varying
COMPILE_ARCHwhen the compile arch is not actually changing seems dodgy to me.In any case, binaries that run on the compile host should build with HOSTCC/HOSTCFLAGS. That seems a pretty simple and obvious rule that I do not want to introduce exceptions to.
Can you please explain what you want us to do.
When you modify COMPILE_ARCH to x86_64, you should also modify HOSTCFLAGS to include -m64. We can set HOSTCC/HOSTCFLAGS with '?=' assignment for this purpose, in Config.mk. Or, perhaps better, you can set both COMPILE_ARCH and HOSTCC/HOSTCFLAGS as you like in config/SunOS.mk based on XEN_TARGET_ARCH, if that's always the sane thing to do on Solaris.
-- Keir
Quoted 3 lines · Keir Fraser
In any case, binaries that run on the compile host should build with HOSTCC/HOSTCFLAGS. That seems a pretty simple and obvious rule that I do not want to introduce exceptions to.
And besides, this is irrelevant since that code does not run under a cross-compile, so trying to pretend there's some difference makes no sense.
john