Jörg Fischer wrote:
Hi, Uwe Hermann schrieb:
Unrelated issue: My OpenSUSE 11.2 Beta Box needs "make CFLAGS=-fno-strict-aliasing" GCC is "gcc version 4.4.1 [gcc-4_4-branch revision 149935] (SUSE Linux)"
Can you post the full build output of your compiler here, so we can fix the actual issue (so that fno-strict-aliasing is hopefully no longer needed).
Here it is: cc -Os -Wall -Werror -D'SERPROG_SUPPORT=1' -D'FLASHROM_VERSION="0.9.1-runknown"' -o physmap.o -c physmap.c cc1: warnings being treated as errors physmap.c: In function ârdmsrâ: physmap.c:146: error: dereferencing type-punned pointer will break strict-aliasing rules make: *** [physmap.o] Fehler 1
This issue has already been reported on this list.
Does the following patch fix compilation for you?
Best regards, Stefan
fix for gcc 4.4 strict aliasing rules.
Signed-off-by: Stefan Reinauer stepan@coresystems.de
Index: physmap.c =================================================================== --- physmap.c (revision 713) +++ physmap.c (working copy) @@ -133,7 +133,7 @@
msr_t rdmsr(int addr) { - uint8_t buf[8]; + uint32_t buf[2]; msr_t msr = { 0xffffffff, 0xffffffff };
if (lseek(fd_msr, (off_t) addr, SEEK_SET) == -1) { @@ -143,8 +143,8 @@ }
if (read(fd_msr, buf, 8) == 8) { - msr.lo = *(uint32_t *)buf; - msr.hi = *(uint32_t *)(buf + 4); + msr.lo = buf[0]; + msr.hi = buf[1];
return msr; }