Opened 8 years ago

Closed 8 years ago

#53140 closed defect (fixed)

cctools @895_3 do not build on PPC Tiger, Mac OS X 10.4.11, because OFILE_LLVM_BITCODE macro is used in misc/strings.c

Reported by: ballapete (Peter "Pete" Dyballa) Owned by: jeremyhu (Jeremy Huddleston Sequoia)
Priority: Normal Milestone:
Component: ports Version:
Keywords: tiger powerpc Cc: ballapete (Peter "Pete" Dyballa)
Port: cctools

Description

misc/strings.c contains:

	if(ofile->object_addr == NULL || ofile->member_type == OFILE_LLVM_BITCODE){

In include/stuff/ofile.c stands:

enum ofile_type {
    OFILE_UNKNOWN,
    OFILE_FAT,
    OFILE_ARCHIVE,
    OFILE_Mach_O
#ifdef LTO_SUPPORT
    ,
    OFILE_LLVM_BITCODE
#endif /* LTO_SUPPORT */
};

which is pre-processed to:

enum ofile_type {
    OFILE_UNKNOWN,
    OFILE_FAT,
    OFILE_ARCHIVE,
    OFILE_Mach_O




};

so that GCC has to state:

:info:build /opt/local/bin/gcc-apple-4.2 -Os -std=gnu99 -Os  -DTRIE_SUPPORT -g -Wall -I. -I./../include -I. -I/opt/local/include -I/opt/local/var/macports/build/_opt_local_var_macports_sources_lil.fr.rsync.macports.org_release_tarballs_ports_devel_cctools/cctools/work/cctools-895/../ld64-274.1/src/abstraction -I/opt/local/var/macports/build/_opt_local_var_macports_sources_lil.fr.rsync.macports.org_release_tarballs_ports_devel_cctools/cctools/work/cctools-895/../ld64-274.1/src/other -I/opt/local/var/macports/build/_opt_local_var_macports_sources_lil.fr.rsync.macports.org_release_tarballs_ports_devel_cctools/cctools/work/cctools-895/include -I/opt/local/include -arch ppc  -c -o ./strings.o strings.c
:info:build In file included from ./../include/stuff/bytesex.h:53,
:info:build                  from ./../include/stuff/ofile.h:39,
:info:build                  from strings.c:80:
:info:build ./../include/mach/arm/thread_status.h:29:1: warning: "THREAD_STATE_NONE" redefined
:info:build In file included from ./../include/stuff/bytesex.h:50,
:info:build                  from ./../include/stuff/ofile.h:39,
:info:build                  from strings.c:80:
:info:build ./../include/mach/i386/thread_status.h:112:1: warning: this is the location of the previous definition
:info:build In file included from ./../include/stuff/bytesex.h:53,
:info:build                  from ./../include/stuff/ofile.h:39,
:info:build                  from strings.c:80:
:info:build ./../include/mach/arm/thread_status.h:50:1: warning: "VALID_THREAD_STATE_FLAVOR" redefined
:info:build In file included from ./../include/stuff/bytesex.h:50,
:info:build                  from ./../include/stuff/ofile.h:39,
:info:build                  from strings.c:80:
:info:build ./../include/mach/i386/thread_status.h:130:1: warning: this is the location of the previous definition
:info:build In file included from ./../include/stuff/bytesex.h:53,
:info:build                  from ./../include/stuff/ofile.h:39,
:info:build                  from strings.c:80:
:info:build ./../include/mach/arm/thread_status.h:105:1: warning: "MACHINE_THREAD_STATE" redefined
:info:build In file included from ./../include/stuff/bytesex.h:50,
:info:build                  from ./../include/stuff/ofile.h:39,
:info:build                  from strings.c:80:
:info:build ./../include/mach/i386/thread_status.h:286:1: warning: this is the location of the previous definition
:info:build In file included from ./../include/stuff/bytesex.h:53,
:info:build                  from ./../include/stuff/ofile.h:39,
:info:build                  from strings.c:80:
:info:build ./../include/mach/arm/thread_status.h:106:1: warning: "MACHINE_THREAD_STATE_COUNT" redefined
:info:build In file included from ./../include/stuff/bytesex.h:50,
:info:build                  from ./../include/stuff/ofile.h:39,
:info:build                  from strings.c:80:
:info:build ./../include/mach/i386/thread_status.h:287:1: warning: this is the location of the previous definition
:info:build In file included from ./../include/stuff/ofile.h:39,
:info:build                  from strings.c:80:
:info:build ./../include/stuff/bytesex.h:244: warning: 'struct __darwin_i386_float_state' declared inside parameter list
:info:build ./../include/stuff/bytesex.h:244: warning: its scope is only this definition or declaration, which is probably not what you want
:info:build strings.c: In function 'ofile_processor':
:info:build strings.c:338: error: 'OFILE_LLVM_BITCODE' undeclared (first use in this function)
:info:build strings.c:338: error: (Each undeclared identifier is reported only once
:info:build strings.c:338: error: for each function it appears in.)
:info:build make[1]: *** [strings.o] Error 1
:info:build make[1]: Leaving directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_lil.fr.rsync.macports.org_release_tarballs_ports_devel_cctools/cctools/work/cctools-895/misc'

Attachments (2)

main.log (684.9 KB) - added by ballapete (Peter "Pete" Dyballa) 8 years ago.
cctools-895-OFILE_LLVM_BITCODE.patch (729 bytes) - added by ballapete (Peter "Pete" Dyballa) 8 years ago.

Download all attachments as: .zip

Change History (6)

Changed 8 years ago by ballapete (Peter "Pete" Dyballa)

Attachment: main.log added

comment:1 Changed 8 years ago by ballapete (Peter "Pete" Dyballa)

The following patch fixes the problem:

--- misc/strings.c-orig	2016-12-09 19:03:02.000000000 +0100
+++ misc/strings.c	2016-12-23 10:35:34.000000000 +0100
@@ -335,8 +335,13 @@
 	 * If the ofile is not an object file then process it without reguard
 	 * to sections.
 	 */
-	if(ofile->object_addr == NULL || ofile->member_type == OFILE_LLVM_BITCODE){
-	    if(ofile->file_type == OFILE_FAT && ofile->arch_flag.cputype != 0){
+	if(ofile->object_addr == NULL
+#ifdef LTO_SUPPORT
+	   || ofile->member_type == OFILE_LLVM_BITCODE){
+#else
+	  ){
+#endif /* LTO_SUPPORT */
+	  if(ofile->file_type == OFILE_FAT && ofile->arch_flag.cputype != 0){
 		if(ofile->fat_header->magic == FAT_MAGIC_64){
 		    addr = ofile->file_addr +
 			   ofile->fat_archs64[ofile->narch].offset;
Last edited 8 years ago by ballapete (Peter "Pete" Dyballa) (previous) (diff)

Changed 8 years ago by ballapete (Peter "Pete" Dyballa)

comment:2 Changed 8 years ago by mf2k (Frank Schima)

Cc: jeremyhu@… removed
Keywords: tiger powerpc added
Owner: set to jeremyhu
Status: newassigned

comment:3 Changed 8 years ago by ballapete (Peter "Pete" Dyballa)

Cc: ballapete added

comment:4 Changed 8 years ago by jeremyhu (Jeremy Huddleston Sequoia)

Resolution: fixed
Status: assignedclosed

In fe6f7000/macports-ports:

cctools: Fix biuld without LTO support

Fixes #53140

Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@…>

Note: See TracTickets for help on using tickets.