Package: acpica-unix
Version: N/A
Author: Guillem Jover <guillem@debian.org>
Status: applied
Debbug: 401153
Description:
 Fix segmentation faults on all arches, this is still not endian clean,
 so it's producing bogus output.


--- compiler/aslopcodes.c	2006-09-12 20:49:25.000000000 +0300
+++ compiler/aslopcodes.c	2006-11-27 09:40:52.000000000 +0200
@@ -329,6 +329,7 @@
             }
             break;
 
+#ifndef ACPI_NO_INTEGER64_SUPPORT
         case ACPI_INTEGER_MAX:
 
             /* Check for table integer width (32 or 64) */
@@ -341,6 +342,7 @@
                 return 1;
             }
             break;
+#endif
 
         default:
             break;
--- compiler/Makefile	2006-09-12 20:49:26.000000000 +0300
+++ compiler/Makefile	2006-11-27 06:48:01.000000000 +0200
@@ -89,7 +89,8 @@
 	../osunixxf.c
 
 NOMAN=	YES
-CFLAGS+= -Wall -O2 -Wstrict-prototypes -D_LINUX -DACPI_ASL_COMPILER -I../include 
+MK_CFLAGS = -DACPI_ASL_COMPILER -I../include
+CFLAGS= -Wall -Wstrict-prototypes -O2
 
 #YACC=	yacc
 YACC=	bison
@@ -103,6 +104,9 @@
 #CFLAGS+= -D_USE_BERKELEY_YACC
 #.endif
 
+%.o: %.c
+	$(CC) $(MK_CFLAGS) $(CFLAGS) -c -o $@ $<
+
 aslmain : $(patsubst %.c,%.o, $(SRCS))
 	$(CC) $(LDFLAGS) $(patsubst %.c,%.o, $(SRCS)) \
 		$(LOADLIBES) $(LDLIBS) -o iasl
--- debian/rules	2006-11-27 06:38:05.000000000 +0200
+++ debian/rules	2006-11-27 06:40:31.000000000 +0200
@@ -32,7 +32,7 @@
 
 	# Commands to compile the package.
 	cd compiler && \
-	$(MAKE) && \
+	$(MAKE) CFLAGS="$(CFLAGS)" && \
 	cd ..
 
 	touch build-stamp
--- include/actypes.h	2006-09-12 20:49:31.000000000 +0300
+++ include/actypes.h	2006-11-27 09:37:32.000000000 +0200
@@ -274,6 +272,7 @@
 #define ACPI_MAX_PTR                    ACPI_UINT32_MAX
 #define ACPI_SIZE_MAX                   ACPI_UINT32_MAX
 
+#define ACPI_NO_INTEGER64_SUPPORT
 
 /*******************************************************************************
  *
--- include/platform/aclinux.h	2006-09-12 20:49:32.000000000 +0300
+++ include/platform/aclinux.h	2006-11-27 07:18:34.000000000 +0200
@@ -146,8 +146,9 @@
 #include <stdlib.h>
 #include <ctype.h>
 #include <unistd.h>
+#include <endian.h>
 
-#if defined(__ia64__) || defined(__x86_64__)
+#if defined(__ia64__) || defined(__x86_64__) || defined(__alpha__)
 #define ACPI_MACHINE_WIDTH          64
 #define COMPILER_DEPENDENT_INT64    long
 #define COMPILER_DEPENDENT_UINT64   unsigned long
@@ -158,6 +159,10 @@
 #define ACPI_USE_NATIVE_DIVIDE
 #endif
 
+#if __BYTE_ORDER == __BIG_ENDIAN
+#define ACPI_BIG_ENDIAN
+#endif
+
 #define __cdecl
 #define ACPI_FLUSH_CPU_CACHE()
 #endif /* __KERNEL__ */
--- tools/acpiexec/Makefile	2006-09-12 20:49:39.000000000 +0300
+++ tools/acpiexec/Makefile	2006-11-27 06:48:25.000000000 +0200
@@ -129,8 +129,12 @@
 	../../osunixxf.c
 
 
-CFLAGS+= -Wall -g -D_LINUX -DNDEBUG -D_CONSOLE -DACPI_EXEC_APP -D_MULTI_THREADED -Wstrict-prototypes -I../../include 
+MK_CFLAGS = -DNDEBUG -D_CONSOLE -DACPI_EXEC_APP -D_MULTI_THREADED \
+            -I../../include
+CFLAGS = -Wall -Wstrict-prototypes -O2 -g
 
+%.o: %.c
+	$(CC) $(MK_CFLAGS) $(CFLAGS) -c -o $@ $<
 
 acpiexec : $(patsubst %.c,%.o, $(SRCS))
 	$(CC) $(LDFLAGS) $(patsubst %.c,%.o, $(SRCS)) -o $(PROG)
--- tools/acpisrc/Makefile	2006-09-12 20:49:40.000000000 +0300
+++ tools/acpisrc/Makefile	2006-11-27 06:48:32.000000000 +0200
@@ -4,8 +4,11 @@
 SRCS=	ascase.c asconvrt.c asfile.c asmain.c asremove.c astable.c \
         asutils.c osunixdir.c ../../common/getopt.c
 
-CFLAGS+= -Wall -O2 -D_LINUX -DACPI_APPLICATION -Wstrict-prototypes -I../../include 
+MK_CFLAGS= -DACPI_APPLICATION -I../../include
+CFLAGS= -Wall -Wstrict-prototypes -O2
 
+%.o: %.c
+	$(CC) $(MK_CFLAGS) $(CFLAGS) -c -o $@ $<
 
 aslmain : $(patsubst %.c,%.o, $(SRCS))
 	$(CC) $(LDFLAGS) $(patsubst %.c,%.o, $(SRCS)) -o $(PROG)
--- tools/acpixtract/Makefile	2006-09-12 20:49:40.000000000 +0300
+++ tools/acpixtract/Makefile	2006-11-27 06:48:38.000000000 +0200
@@ -3,8 +3,11 @@
 PROG=	acpixtract
 SRCS=	acpixtract.c
 
-CFLAGS+= -Wall -O2 -D_LINUX -DACPI_APPLICATION -Wstrict-prototypes -I../../include 
+MK_CFLAGS= -DACPI_APPLICATION -I../../include
+CFLAGS= -Wall -Wstrict-prototypes -O2
 
+%.o: %.c
+	$(CC) $(MK_CFLAGS) $(CFLAGS) -c -o $@ $<
 
 acpixtract : $(patsubst %.c,%.o, $(SRCS))
 	$(CC) $(LDFLAGS) $(patsubst %.c,%.o, $(SRCS)) -o $(PROG)

