Various acpica cleanups
trenn at suse.de
cover Various acpica cleanups
Hi,
these are the patches on latest acpica needed for SUSE packaging.
Please ignore the acpidump patch.
Not sure about the "avoid void cast warning in 32-bit case" and the "Do not compile in date/time" patch. If one or both can go in that's fine, if not, it's not a big deal.
The others are cleanups/fixes which I'd appreciate if they can get applied to latest acpica code base so that we do not have to maintain them forever in our package.
Thanks,
Thomas
trenn at suse.de
PATCH 1/6 acpcia: Make it possible to pass additional CFLAGS when invoking make
-D_FORTIFY_SOURCE=2 without -O2 can cause:
--
/usr/include/features.h:314:4: error: #warning _FORTIFY_SOURCE requires compiling with optimization (-O) [-Werror=cpp]
--
Such compiler flags must be able to get passed when invoking make. OpenSUSE packages require to build binaries with CLFAGS="$RPM_OPT_FLAGS", to make sure debuginfo can be obtained, security/optimization flags of the compiler for the distribution built against are passed, etc.
This patch differs between:
1) Optional CFLAGS (OPT_CFLAGS) which have a sane default:
-D_FORTIFY_SOURCE=2 -O2 and warning flags These will get replaced if OPT_CFLAGS= are passed via make OPT_CFLAGS=".." invokation
2) Elementary CFLAGS (-I includes, -Dxy, ...) which are mandatory for a successful compile run
--- generate/unix/Makefile.config | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-)
generate/unix/Makefile.config +6 -2
@@ -38,7 +38,7 @@ CC = gcc OBJDIR = obj$(BITS) BINDIR = bin$(BITS) BITSFLAG = -m$(BITS) -COMPILEOBJ = $(CC) -c $(CFLAGS) $(CWARNINGFLAGS) -o$@ $< +COMPILEOBJ = $(CC) -c $(CFLAGS) -o$@ $< LINKPROG = $(CC) $(OBJECTS) -o $(PROG) $(LDFLAGS) INSTALLDIR = /usr/bin INSTALLPROG = install -D ../$(BINDIR)/$(PROG) $(DESTDIR)$(INSTALLDIR)/$(PROG)
@@ -103,11 +103,15 @@ ACPICA_HEADERS = \ # Common compiler flags. The warning flags in addition to -Wall are not # automatically included in -Wall. # +OPT_CFLAGS ?= \ + -D_FORTIFY_SOURCE=2 -O2 \ + $(CWARNINGFLAGS) + CFLAGS += \ + $(OPT_CFLAGS) \ $(BITSFLAG) \ -D$(HOST) \ -D_GNU_SOURCE \ - -D_FORTIFY_SOURCE=2 \ -I$(ACPICA_INCLUDE) LDFLAGS += $(BITSFLAG)
trenn at suse.de
PATCH 2/6 Make it possible to extend CFLAGS when invoking make
In reply to trenn at suse.deFrom: Thomas Renninger <trenn(a)suse.de>
--- acpidump/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
acpidump/Makefile +1 -1
@@ -1,7 +1,7 @@ PROG= acpidump SRCS= acpidump.c KERNEL_INCLUDE := ../include -CFLAGS += -Wall -Wstrict-prototypes -Wdeclaration-after-statement -Os -s -D_LINUX -DDEFINE_ALTERNATE_TYPES -I$(KERNEL_INCLUDE) +override CFLAGS += -Wall -Wstrict-prototypes -Wdeclaration-after-statement -Os -s -D_LINUX -DDEFINE_ALTERNATE_TYPES -I$(KERNEL_INCLUDE) all: acpidump $(PROG) : $(SRCS)
Thomas Renninger
Re: [Devel] [patch 2/6] Make it possible to extend CFLAGS when invoking make
Quoted 4 lines · trenn(a)suse.de
From: Thomas Renninger <trenn(a)suse.de>
--- acpidump/Makefile | 2 +-
This is from acpidump/pmtools, not from acpica, please ignore.
Thomas
trenn at suse.de
PATCH 3/6 From: <[email protected]>
In reply to trenn at suse.deacpica: Do not compile in date or time into binaries
Otherwise the data/time compiled in may cause constant re-compilation in build service environments
--- source/compiler/aslcompile.c | 9 ++------- source/compiler/aslutils.c | 4 ++-- source/include/acapps.h | 8 ++++---- 3 files changed, 8 insertions(+), 13 deletions(-)
source/compiler/aslcompile.c +2 -7
@@ -161,8 +161,6 @@ voidAslCompilerFileHeader ( UINT32 FileId) { -struct tm *NewTime; -time_t Aclock;char *Prefix ="" ;
@@ -202,12 +200,9 @@ AslCompilerFileHeader (/* Compilation header with timestamp */ - (void )time (&Aclock); - NewTime =localtime (&Aclock); -FlPrintFile (FileId, -"%sCompilation of \"%s\" - %s%s\n" , - Prefix, Gbl_Files[ASL_FILE_INPUT ].Filename,asctime (NewTime), +"%sCompilation of \"%s\"\n" , + Prefix, Gbl_Files[ASL_FILE_INPUT ].Filename, Prefix); switch (FileId)
source/compiler/aslutils.c +2 -2
@@ -456,8 +456,8 @@ UtDisplaySummary ( {/* Compiler name and version number */ -FlPrintFile (FileId,"%s version %X%s [%s]\n\n" , -ASL_COMPILER_NAME , (UINT32 )ACPI_CA_VERSION ,ACPI_WIDTH , __DATE__); +FlPrintFile (FileId,"%s version %X%s\n\n" , +ASL_COMPILER_NAME , (UINT32 )ACPI_CA_VERSION ,ACPI_WIDTH ); }/* Summary of main input and output files */
source/include/acapps.h +4 -4
@@ -69,15 +69,15 @@/* Macros for signons and file headers */ #define ACPI_COMMON_SIGNON (UtilityName) \ - "\n%s\n%s version %8.8X%s [%s]\n%s\n\n", \ + "\n%s\n%s version %8.8X%s\n%s\n\n", \ ACPICA_NAME, \ - UtilityName, ((UINT32) ACPI_CA_VERSION), ACPI_WIDTH, __DATE__, \ + UtilityName, ((UINT32) ACPI_CA_VERSION), ACPI_WIDTH, \ ACPICA_COPYRIGHT#define ACPI_COMMON_HEADER (UtilityName, Prefix) \ - "%s%s\n%s%s version %8.8X%s [%s]\n%s%s\n%s\n", \ + "%s%s\n%s%s version %8.8X%s\n%s%s\n%s\n", \ Prefix, ACPICA_NAME, \ - Prefix, UtilityName, ((UINT32) ACPI_CA_VERSION), ACPI_WIDTH, __DATE__, \ + Prefix, UtilityName, ((UINT32) ACPI_CA_VERSION), ACPI_WIDTH, \ Prefix, ACPICA_COPYRIGHT, \ Prefix
Thomas Renninger
Re: [Devel] [patch 3/6] From: <[email protected]>
Quoted 2 lines · trenn(a)suse.de
acpica: Do not compile in date or time into binaries
Argh, quilt does not know the From: header...
If it's not a big deal that the date/time of compilation shows up in the binary, it would be nice to see this one getting applied, otherwise, just ignore.
Thomas
Moore
Re: [Devel] [patch 3/6] From: <[email protected]>
In reply to trenn at suse.deThomas,
This code is not used to insert the date/time into AML "binaries". It is used for the various listing files.
Can you explain further?
Bob
Quoted 96 lines
-----Original Message-----
From: devel-bounces(a)acpica.org [mailto:devel-bounces(a)acpica.org] On Behalf Of trenn(a)suse.de
Sent: Wednesday, September 19, 2012 4:15 AM
To: devel(a)acpica.org
Subject: [Devel] [patch 3/6] From: <idoenmez(a)suse.de>acpica: Do not compile in date or time into binaries
Otherwise the data/time compiled in may cause constant re-compilation in build service environments
Signed-off-by Thomas Renninger <trenn(a)suse.de>--- source/compiler/aslcompile.c | 9 ++------- source/compiler/aslutils.c | 4 ++-- source/include/acapps.h | 8 ++++---- 3 files changed, 8 insertions(+), 13 deletions(-)Index:
acpica-unix2-20120913/source/compiler/aslcompile.c
==========================================================
=========source/compiler/aslcompile.c +2
-7@@ -161,8 +161,6 @@ voidAslCompilerFileHeader ( UINT32 FileId) { -struct tm *NewTime; -time_t Aclock;char *Prefix ="" ;@@ -202,12 +200,9 @@ AslCompilerFileHeader (/* Compilation header with timestamp */ - (void )time (&Aclock); - NewTime =localtime (&Aclock); -FlPrintFile (FileId, -"%sCompilation of \"%s\" - %s%s\n" , - Prefix, Gbl_Files[ASL_FILE_INPUT ].Filename,asctime (NewTime), +"%sCompilation of \"%s\"\n" , + Prefix, Gbl_Files[ASL_FILE_INPUT ].Filename, Prefix); switch (FileId)Index:
acpica-unix2-20120913/source/compiler/aslutils.c
==========================================================
=========source/compiler/aslutils.c +2
-2@@ -456,8 +456,8 @@ UtDisplaySummary ( {/* Compiler name and version number */ -FlPrintFile (FileId,"%s version %X%s [%s]\n\n" , -ASL_COMPILER_NAME , (UINT32 )ACPI_CA_VERSION ,ACPI_WIDTH , __DATE__); +FlPrintFile (FileId,"%s version %X%s\n\n" , +ASL_COMPILER_NAME , (UINT32 )ACPI_CA_VERSION ,ACPI_WIDTH ); }/* Summary of main input and output files */Index:
acpica-unix2-20120913/source/include/acapps.h
==========================================================
=========source/include/acapps.h +4
-4@@ -69,15 +69,15 @@/* Macros for signons and file headers */ #define ACPI_COMMON_SIGNON (UtilityName) \ - "\n%s\n%s version %8.8X%s [%s]\n%s\n\n", \ + "\n%s\n%s version %8.8X%s\n%s\n\n", \ ACPICA_NAME, \ - UtilityName, ((UINT32) ACPI_CA_VERSION), ACPI_WIDTH, __DATE__, \ + UtilityName, ((UINT32) ACPI_CA_VERSION), ACPI_WIDTH, \ ACPICA_COPYRIGHT#define ACPI_COMMON_HEADER (UtilityName, Prefix) \ - "%s%s\n%s%s version %8.8X%s [%s]\n%s%s\n%s\n", \ + "%s%s\n%s%s version %8.8X%s\n%s%s\n%s\n", \ Prefix, ACPICA_NAME, \ - Prefix, UtilityName, ((UINT32) ACPI_CA_VERSION), ACPI_WIDTH, __DATE__, \ + Prefix, UtilityName, ((UINT32) ACPI_CA_VERSION), ACPI_WIDTH, \ Prefix, ACPICA_COPYRIGHT, \ Prefix_______________________________________________
Devel mailing list
Devel(a)acpica.org
http://lists.acpica.org/listinfo/devel
trenn at suse.de
PATCH 4/6 --- source/include/platform/aclinux.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
In reply to trenn at suse.desource/include/platform/aclinux.h +1 -1
@@ -98,7 +98,7 @@#define COMPILER_DEPENDENT_INT64 long long#define COMPILER_DEPENDENT_UINT64 unsigned long long#define ACPI_USE_NATIVE_DIVIDE -#define ACPI_CAST_PTHREAD_T (pthread) ((ACPI_THREAD_ID) (UINT32) (void *) (pthread)) +#define ACPI_CAST_PTHREAD_T (pthread) ((ACPI_THREAD_ID) (UINT32) (pthread))#endif #ifndef __cdecl
Thomas Renninger
Re: [Devel] [patch 4/6] --- source/include/platform/aclinux.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
source/include/platform/aclinux.h line 101
Quoted 10 lines · trenn(a)suse.de
Index:
acpica-unix2-20120518/source/include/platform/aclinux.h
===================================================================source/include/platform/aclinux.h +1
-1@@ -98,7 +98,7 @@#define COMPILER_DEPENDENT_INT64 long long#define COMPILER_DEPENDENT_UINT64 unsigned long long#define ACPI_USE_NATIVE_DIVIDE -#define ACPI_CAST_PTHREAD_T (pthread) ((ACPI_THREAD_ID) (UINT32) (void *) (pthread)) +#define ACPI_CAST_PTHREAD_T (pthread) ((ACPI_THREAD_ID) (UINT32) (pthread))
Robert already stated that it's difficult to make everyone happy and that the (void *) has explicitly added to make another user (compiler?) happy.
Please ignore.
The others:
1/6, 5/6, 6/6
would be nice if they can get applied.
Thanks,
Thomas
trenn at suse.de
PATCH 5/6 acpica: Fix unused result warning
In reply to trenn at suse.deAs this is the only place where this warning
happens:
'write', declared with attribute warn_unused_result [-Werror=unused-result] it might be worth fixing instead of ignoring.
--- source/tools/acpisrc/asfile.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
source/tools/acpisrc/asfile.c +5 -1
@@ -805,7 +805,11 @@ AsPutFile (/* Write the buffer to the file */ FileSize =strlen (FileBuffer); -write (DestHandle, FileBuffer, FileSize); +if (write (DestHandle, FileBuffer, FileSize) <0 ) { +perror ("Could not write to destination file" ); +close (DestHandle); +return -1 ; + }close (DestHandle);
Moore
Re: [Devel] [patch 5/6] acpica: Fix unused result warning
Thomas,
Someone also reported something similar against the acpibin utility.
However, I don't see these issue on my system running gcc 4.7.1 -- do you have any idea why I don't?
Thanks,
Bob
Quoted 40 lines
-----Original Message-----
From: devel-bounces(a)acpica.org [mailto:devel-bounces(a)acpica.org] On Behalf Of trenn(a)suse.de
Sent: Wednesday, September 19, 2012 4:15 AM
To: devel(a)acpica.org
Subject: [Devel] [patch 5/6] acpica: Fix unused result warningAs this is the only place where this warning
happens:
'write', declared with attributewarn_unused_result[-Werror=unused- result] it might be worth fixing instead of ignoring.Signed-off-by Thomas Renninger <trenn(a)suse.de>--- source/tools/acpisrc/asfile.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)Index:
acpica-unix2-20120913/source/tools/acpisrc/asfile.c
==========================================================
=========source/tools/acpisrc/asfile.c +5
-1@@ -805,7 +805,11 @@ AsPutFile (/* Write the buffer to the file */ FileSize =strlen (FileBuffer); -write (DestHandle, FileBuffer, FileSize); +if (write (DestHandle, FileBuffer, FileSize) <0 ) { +perror ("Could not write to destination file" ); +close (DestHandle); +return -1 ; + }close (DestHandle);_______________________________________________
Devel mailing list
Devel(a)acpica.org
http://lists.acpica.org/listinfo/devel
trenn at suse.de
PATCH 6/6 acpcia: Fixes some minor Tab vs whitespace issues in Makefiles.
In reply to trenn at suse.de--- generate/unix/acpibin/Makefile | 2 +- generate/unix/iasl/Makefile | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-)
generate/unix/acpibin/Makefile +1 -1
@@ -27,7 +27,7 @@ HEADERS = \ $(wildcard $(ACPIBIN)/*.h) OBJECTS = \ - $(OBJDIR)/abcompare.o \ + $(OBJDIR)/abcompare.o \ $(OBJDIR)/abmain.o \ $(OBJDIR)/utalloc.o \ $(OBJDIR)/utcache.o \
generate/unix/iasl/Makefile +3 -3
@@ -192,13 +192,13 @@ INTERMEDIATES = \ $(OBJDIR)/prparserparse.c MISC = \ - $(OBJDIR)/aslcompilerparse.h \ + $(OBJDIR)/aslcompilerparse.h \ $(OBJDIR)/aslcompiler.y.h \ $(OBJDIR)/aslcompilerparse.output \ - $(OBJDIR)/dtparserparse.h \ + $(OBJDIR)/dtparserparse.h \ $(OBJDIR)/dtparser.y.h \ $(OBJDIR)/dtparserparse.output \ - $(OBJDIR)/prparserparse.h \ + $(OBJDIR)/prparserparse.h \ $(OBJDIR)/prparser.y.h \ $(OBJDIR)/prparserparse.output
Moore
Re: [Devel] [patch 6/6] acpcia: Fixes some minor Tab vs whitespace issues in Makefiles.
OK, thanks.
Bob
Quoted 55 lines
-----Original Message-----
From: devel-bounces(a)acpica.org [mailto:devel-bounces(a)acpica.org] On Behalf Of trenn(a)suse.de
Sent: Wednesday, September 19, 2012 4:15 AM
To: devel(a)acpica.org
Subject: [Devel] [patch 6/6] acpcia: Fixes some minor Tab vs whitespace issues in Makefiles.Signed-off-by Thomas Renninger <trenn(a)suse.de>--- generate/unix/acpibin/Makefile | 2 +- generate/unix/iasl/Makefile | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-)Index: acpica-unix2-20120913/generate/unix/acpibin/Makefile
==========================================================
=========generate/unix/acpibin/Makefile +1
-1@@ -27,7 +27,7 @@ HEADERS = \ $(wildcard $(ACPIBIN)/*.h) OBJECTS = \ - $(OBJDIR)/abcompare.o \ + $(OBJDIR)/abcompare.o \ $(OBJDIR)/abmain.o \ $(OBJDIR)/utalloc.o \ $(OBJDIR)/utcache.o \Index: acpica-unix2-20120913/generate/unix/iasl/Makefile
==========================================================
=========generate/unix/iasl/Makefile +3
-3@@ -192,13 +192,13 @@ INTERMEDIATES = \ $(OBJDIR)/prparserparse.c MISC = \ - $(OBJDIR)/aslcompilerparse.h \ + $(OBJDIR)/aslcompilerparse.h \ $(OBJDIR)/aslcompiler.y.h \ $(OBJDIR)/aslcompilerparse.output \ - $(OBJDIR)/dtparserparse.h \ + $(OBJDIR)/dtparserparse.h \ $(OBJDIR)/dtparser.y.h \ $(OBJDIR)/dtparserparse.output \ - $(OBJDIR)/prparserparse.h \ + $(OBJDIR)/prparserparse.h \ $(OBJDIR)/prparser.y.h \ $(OBJDIR)/prparserparse.output_______________________________________________
Devel mailing list
Devel(a)acpica.org
http://lists.acpica.org/listinfo/devel
Thomas Renninger
[Devel] [patch 7/6] Fix Itanium build
In reply to trenn at suse.deacpica: IA64 does not know about -m64
Otherwise you get on Itanium:
gcc: error: unrecognized command line option '-m64'
--- generate/unix/Makefile.config | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
generate/unix/Makefile.config +3 -1
@@ -37,7 +37,9 @@ CC = gcc # OBJDIR = obj$(BITS) BINDIR = bin$(BITS) -BITSFLAG = -m$(BITS) +ifneq($(HARDWARE_NAME),ia64) + BITSFLAG = -m$(BITS) +fi COMPILEOBJ = $(CC) -c $(CFLAGS) -o$@ $< LINKPROG = $(CC) $(OBJECTS) -o $(PROG) $(LDFLAGS) INSTALLDIR = /usr/bin
Thomas Renninger
Re: [Devel] [patch 7/6] Fix Itanium build - v2
acpica: IA64 does not know about -m64
Otherwise you get on Itanium:
gcc: error: unrecognized command line option '-m64'
--- generate/unix/Makefile.config | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
generate/unix/Makefile.config +3 -1
@@ -37,7 +37,9 @@ CC = gcc # OBJDIR = obj$(BITS) BINDIR = bin$(BITS) -BITSFLAG = -m$(BITS) +ifneq ($(shell uname -m),ia64) + BITSFLAG = -m$(BITS) +endif COMPILEOBJ = $(CC) -c $(CFLAGS) -o$@ $< LINKPROG = $(CC) $(OBJECTS) -o $(PROG) $(LDFLAGS) INSTALLDIR = /usr/bin
Moore
Re: [Devel] [patch 7/6] Fix Itanium build - v2
Makefile.common already contains this line, you may be able to use $(HARDWARE_NAME)
HARDWARE_NAME := $(shell uname -m)
Quoted 38 lines
-----Original Message-----
From: devel-bounces(a)acpica.org [mailto:devel-bounces(a)acpica.org] On Behalf Of Thomas Renninger
Sent: Wednesday, September 19, 2012 8:28 AM
To: devel(a)acpica.org
Subject: Re: [Devel] [patch 7/6] Fix Itanium build - v2acpica: IA64 does not know about -m64
Otherwise you get on Itanium:
gcc: error: unrecognized command line option '-m64'Signed-off-by Thomas Renninger <trenn(a)suse.de>--- generate/unix/Makefile.config | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)Index:
acpica-unix-20120913/generate/unix/Makefile.config
==========================================================
=========generate/unix/Makefile.config +3
-1@@ -37,7 +37,9 @@ CC = gcc # OBJDIR = obj$(BITS) BINDIR = bin$(BITS) -BITSFLAG = -m$(BITS) +ifneq ($(shell uname -m),ia64) + BITSFLAG = -m$(BITS) +endif COMPILEOBJ = $(CC) -c $(CFLAGS) -o$@ $< LINKPROG = $(CC) $(OBJECTS) -o $(PROG) $(LDFLAGS) INSTALLDIR = /usr/bin_______________________________________________
Devel mailing list
Devel(a)acpica.org
http://lists.acpica.org/listinfo/devel
Thomas Renninger
Re: [Devel] [patch 7/6] Fix Itanium build - v2
Quoted 3 lines · Robert
Makefile.common already contains this line, you may be able to use $(HARDWARE_NAME)
HARDWARE_NAME:= $(shell uname -m)
I tried that, but it did not work out.
It's because the order of the including in the main makefile:
include Makefile.config
include Makefile.common
Below patch works:
acpica: IA64 does not know about -m64
Otherwise you get on Itanium:
gcc: error: unrecognized command line option '-m64'
--- generate/unix/Makefile.common | 1 - generate/unix/Makefile.config | 6 +++++- 2 files changed, 5 insertions(+), 2 deletions(-)
generate/unix/Makefile.config +5 -1
@@ -35,9 +35,13 @@ CC = gcc # # Common defines # +HARDWARE_NAME := $(shell uname -m) + OBJDIR = obj$(BITS) BINDIR = bin$(BITS) -BITSFLAG = -m$(BITS) +ifneq (${HARDWARE_NAME},ia64) + BITSFLAG = -m$(BITS) +endif COMPILEOBJ = $(CC) -c $(CFLAGS) -o$@ $< LINKPROG = $(CC) $(OBJECTS) -o $(PROG) $(LDFLAGS) INSTALLDIR = /usr/bin
generate/unix/Makefile.common +0 -1
@@ -6,7 +6,6 @@ # Get the OS machine architecture. Anything with a "64" in the returned # string will be treated as a 64-bit OS. Otherwise, the default is 32-bit. # -HARDWARE_NAME := $(shell uname -m) BITS=0 #
Moore
Re: [Devel] [patch 7/6] Fix Itanium build - v2
Can you just add the new case to the rules in Makefile.common?
#
# Main rule will only generate versions that are appropriate for the running # OS, either 64-bit or 32-bit.
#
all: ${PROGS}
${PROGS}: FORCE
@cd $(BUILD_DIRECTORY_PATH)/$@; \ if [ $(BITS) -eq 32 ]; then \ echo "Forced 32-bit generation of $@"; \ mkdir -p obj32; \ make BITS=32; \ echo "32-bit version of $@:"; \ ls -al ../bin32/$@; \ elif [ $(findstring 64,$(HARDWARE_NAME)) ]; then \ mkdir -p obj64; \ make BITS=64; \ echo "64-bit version of $@:"; \ ls -al ../bin64/$@; \ else \ mkdir -p obj32; \ make BITS=32; \ echo "32-bit version of $@:"; \ ls -al ../bin32/$@; \ fi;
Quoted 65 lines
-----Original Message-----
From: Thomas Renninger [mailto:trenn(a)suse.de]
Sent: Wednesday, September 19, 2012 8:58 AM
To: Moore, Robert
Cc: devel(a)acpica.org
Subject: Re: [Devel] [patch 7/6] Fix Itanium build - v2Quoted 4 lines · Robert
Makefile.common already contains this line, you may be able to use $(HARDWARE_NAME)
HARDWARE_NAME:= $(shell uname -m)I tried that, but it did not work out.
It's because the order of the including in the main makefile:include Makefile.config
include Makefile.commonBelow patch works:
acpica: IA64 does not know about -m64
Otherwise you get on Itanium:
gcc: error: unrecognized command line option '-m64'Signed-off-by Thomas Renninger <trenn(a)suse.de>--- generate/unix/Makefile.common | 1 - generate/unix/Makefile.config | 6 +++++- 2 files changed, 5 insertions(+), 2 deletions(-)Index:
acpica-unix-20120913/generate/unix/Makefile.config
==========================================================
=========generate/unix/Makefile.config +5
-1@@ -35,9 +35,13 @@ CC = gcc # # Common defines # +HARDWARE_NAME := $(shell uname -m) + OBJDIR = obj$(BITS) BINDIR = bin$(BITS) -BITSFLAG = -m$(BITS) +ifneq (${HARDWARE_NAME},ia64) + BITSFLAG = -m$(BITS) +endif COMPILEOBJ = $(CC) -c $(CFLAGS) -o$@ $< LINKPROG = $(CC) $(OBJECTS) -o $(PROG) $(LDFLAGS) INSTALLDIR = /usr/binIndex: acpica-unix-20120913/generate/unix/Makefile.common
==========================================================
=========generate/unix/Makefile.common +0
-0@@ -6,7 +6,6 @@ # Get the OS machine architecture. Anything with a "64" in the returned #string will be treated as a 64-bit OS. Otherwise, the default is 32-bit.
#
-HARDWARE_NAME := $(shell uname -m)
BITS=0#
Thomas Renninger
Re: [Devel] [patch 7/6] Fix Itanium build - v2
Quoted 1 line · Robert
Can you just add the new case to the rules in Makefile.common?
No, at least I can't see a nice way to do so.
Quoted 6 lines
#
# Main rule will only generate versions that are appropriate for the running # OS, either 64-bit or 32-bit.
#
all: ${PROGS}
${PROGS}: FORCE
Quoted 8 lines
@cd $(BUILD_DIRECTORY_PATH)/$@; \ if [ $(BITS) -eq 32 ]; then \ echo "Forced 32-bit generation of $@"; \ mkdir -p obj32; \ make BITS=32; \ echo "32-bit version of $@:"; \ ls -al ../bin32/$@; \ elif [ $(findstring 64,$(HARDWARE_NAME)) ]; then \
The ia64 case should match this condition already. But the variable:
BITSFLAG = -m$(BITS)
is not touched here.
Whatever you do here one would always get a:
-mX
option added to the compiler flags by:
BITSFLAG = -m$(BITS)
in the other Makefile (.config)
-m32 and -m64 does exist for PPC/Sparc/x86 gcc versions, but it does not exist for Itanium or ARM or other architectures.
I can't see a much cleaner way than my previous patch (see at the end of the mail).
I wonder why the extra complexity to be able to compile 32- and 64- bit together was made. The code could be shorter/nicer if this is not needed.
It should be possible to provide something like:
make OPT_CFLAGS=-m32 OPT_LDFLAGS=-m32
if it's really necessary (what for?) to be able to compile a 32 bit version on a 64 bit system.
I guess I do not want to try this out without knowing the background.
Thomas
Quoted 80 lines
mkdir -p obj64; \ make BITS=64; \ echo "64-bit version of $@:"; \ ls -al ../bin64/$@; \ else \ mkdir -p obj32; \ make BITS=32; \ echo "32-bit version of $@:"; \ ls -al ../bin32/$@; \ fi;Quoted 65 lines
-----Original Message-----
From: Thomas Renninger [mailto:trenn(a)suse.de]
Sent: Wednesday, September 19, 2012 8:58 AM
To: Moore, Robert
Cc: devel(a)acpica.org
Subject: Re: [Devel] [patch 7/6] Fix Itanium build - v2Quoted 4 lines · Robert
Makefile.common already contains this line, you may be able to use $(HARDWARE_NAME)
HARDWARE_NAME:= $(shell uname -m)I tried that, but it did not work out.
It's because the order of the including in the main makefile:include Makefile.config
include Makefile.commonBelow patch works:
acpica: IA64 does not know about -m64
Otherwise you get on Itanium:
gcc: error: unrecognized command line option '-m64'Signed-off-by Thomas Renninger <trenn(a)suse.de>--- generate/unix/Makefile.common | 1 - generate/unix/Makefile.config | 6 +++++- 2 files changed, 5 insertions(+), 2 deletions(-)Index:
acpica-unix-20120913/generate/unix/Makefile.config
==========================================================
=========generate/unix/Makefile.config +5
-1@@ -35,9 +35,13 @@ CC = gcc # # Common defines # +HARDWARE_NAME := $(shell uname -m) + OBJDIR = obj$(BITS) BINDIR = bin$(BITS) -BITSFLAG = -m$(BITS) +ifneq (${HARDWARE_NAME},ia64) + BITSFLAG = -m$(BITS) +endif COMPILEOBJ = $(CC) -c $(CFLAGS) -o$@ $< LINKPROG = $(CC) $(OBJECTS) -o $(PROG) $(LDFLAGS) INSTALLDIR = /usr/binIndex: acpica-unix-20120913/generate/unix/Makefile.common
==========================================================
=========generate/unix/Makefile.common +0
-0@@ -6,7 +6,6 @@ # Get the OS machine architecture. Anything with a "64" in the returned #string will be treated as a 64-bit OS. Otherwise, the default is 32-bit.
#
-HARDWARE_NAME := $(shell uname -m)
BITS=0#