Skip to contentSkip to conversation

Mac OS X build failure (qemu-img)

Qemu-devel Andreas Färber 2 participants 8 messages Nov 11, 2007 – Jan 7, 2008

lore
Share & tools
lore
#0 lore raw

Hello,

Building CVS HEAD on OS X (here sparc-softmmu) currently results in unresolved symbols:

gcc-3.3 -g -o qemu-img qemu-img.o qemu-img-block.o qemu-img-block-raw.o cutils.o block-cow.o block-qcow.o aes.o block-vmdk.o block-cloop.o block-dmg.o block-bochs.o block-vpc.o block-vvfat.o block-qcow2.o block-parallels.o -lz
ld: Undefined symbols:
_CFDictionarySetValue
_CFRelease
_CFStringGetCString
_IOIteratorNext
_IOMasterPort
_IOObjectRelease
_IORegistryEntryCreateCFProperty
_IOServiceGetMatchingServices
_IOServiceMatching
___CFStringMakeConstantString
_kCFAllocatorDefault
_kCFBooleanTrue
make: *** [qemu-img] Error 1

It seems to be unrelated to Fabrice's Cocoa changes and unrelated to the AIO reversion. My guess is that the CoreFoundation framework or something needs to be linked in. Any idea which commit might have caused this or where to fix?

Thanks,

Andreas

#1 lore raw

Am 11.11.2007 um 13:40 schrieb Andreas Färber:

Quoted 18 lines

Building CVS HEAD on OS X (here sparc-softmmu) currently results in unresolved symbols:

gcc-3.3 -g -o qemu-img qemu-img.o qemu-img-block.o qemu-img-block-raw.o cutils.o block-cow.o block-qcow.o aes.o block-vmdk.o block-cloop.o block-dmg.o block-bochs.o block-vpc.o block-vvfat.o block-qcow2.o block-parallels.o -lz
ld: Undefined symbols:
_CFDictionarySetValue
_CFRelease
_CFStringGetCString
_IOIteratorNext
_IOMasterPort
_IOObjectRelease
_IORegistryEntryCreateCFProperty
_IOServiceGetMatchingServices
_IOServiceMatching
___CFStringMakeConstantString
_kCFAllocatorDefault
_kCFBooleanTrue
make: *** [qemu-img] Error 1

Quoted 1 line

It seems to be unrelated to Fabrice's Cocoa changes and unrelated to the AIO reversion. My guess is that the CoreFoundation framework or something needs to be linked in. Any idea which commit might have caused this or where to fix?

Any hints, anyone? Still haven't figured out where this breakage is coming from, didn't notice any relevant changes in Makefile or configure...

Andreas

#2 lore raw
Quoted 21 lines · Andreas Färber

Am 11.11.2007 um 13:40 schrieb Andreas Färber:

Quoted 18 lines

Building CVS HEAD on OS X (here sparc-softmmu) currently results in unresolved symbols:

gcc-3.3 -g -o qemu-img qemu-img.o qemu-img-block.o qemu-img-block-raw.o cutils.o block-cow.o block-qcow.o aes.o block-vmdk.o block-cloop.o block-dmg.o block-bochs.o block-vpc.o block-vvfat.o block-qcow2.o block-parallels.o -lz
ld: Undefined symbols:
_CFDictionarySetValue
_CFRelease
_CFStringGetCString
_IOIteratorNext
_IOMasterPort
_IOObjectRelease
_IORegistryEntryCreateCFProperty
_IOServiceGetMatchingServices
_IOServiceMatching
___CFStringMakeConstantString
_kCFAllocatorDefault
_kCFBooleanTrue
make: *** [qemu-img] Error 1

Quoted 6 lines
Quoted 1 line

It seems to be unrelated to Fabrice's Cocoa changes and unrelated to the AIO reversion. My guess is that the CoreFoundation framework or something needs to be linked in. Any idea which commit might have caused this or where to fix?

Any hints, anyone? Still haven't figured out where this breakage is coming from, didn't notice any relevant changes in Makefile or configure...

Andreas

Does it work if you specify "-framework CoreFoundation -framework IOKit" in your LDFLAGS? That's what was needed on my Leopard x86_64 build.

Cheers,

Alex

#3 lore raw

Am 12.12.2007 um 13:08 schrieb Alexander Graf:

Quoted 1 line

Does it work if you specify "-framework CoreFoundation -framework IOKit" in your LDFLAGS? That's what was needed on my Leopard x86_64 build.

If I configure with LDFLAGS:
LDFLAGS="-framework CoreFoundation -framework IOKit" ./configure --prefix=/Users/andreas/Q/latest --target-list=sparc-softmmu --enable-cocoa it now ends like this:

gcc-3.3 -Wall -O2 -g -fno-strict-aliasing -I. -I.. -I/Users/andreas/Q/myqemu/target-sparc -I/Users/andreas/Q/myqemu -D__powerpc__ -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -I/Users/andreas/Q/myqemu/fpu -I/Users/andreas/Q/myqemu/slirp -mdynamic-no-pic -c -o cocoa.o /Users/andreas/Q/myqemu/cocoa.m In file included from /System/Library/Frameworks/Foundation.framework/Headers/Foundation.h:15,
from /System/Library/Frameworks/Cocoa.framework/
Headers/Cocoa.h:12,
from /Users/andreas/Q/myqemu/cocoa.m:38:
/System/Library/Frameworks/Foundation.framework/Headers/NSArray.h:62: error: parse error before "__attribute__"
/System/Library/Frameworks/Foundation.framework/Headers/NSArray.h:66: error: parse error before "__attribute__"
In file included from /System/Library/Frameworks/Foundation.framework/Headers/NSAttributedString.h:6,
from /System/Library/Frameworks/Foundation.framework/
Headers/Foundation.h:16,
from /System/Library/Frameworks/Cocoa.framework/
Headers/Cocoa.h:12,
from /Users/andreas/Q/myqemu/cocoa.m:38:
/System/Library/Frameworks/Foundation.framework/Headers/NSDictionary.h:45: error: parse error before "__attribute__"
/System/Library/Frameworks/Foundation.framework/Headers/NSDictionary.h:50: error: parse error before "__attribute__"
In file included from /System/Library/Frameworks/Foundation.framework/Headers/NSHashTable.h:5,
from /System/Library/Frameworks/Foundation.framework/
Headers/Foundation.h:43,
from /System/Library/Frameworks/Cocoa.framework/
Headers/Cocoa.h:12,
from /Users/andreas/Q/myqemu/cocoa.m:38:
/System/Library/Frameworks/Foundation.framework/Headers/NSPointerFunctions.h:59: error: parse error before '@' token
In file included from /System/Library/Frameworks/Foundation.framework/Headers/NSKeyValueCoding.h:9,
from /System/Library/Frameworks/Foundation.framework/
Headers/Foundation.h:49,
from /System/Library/Frameworks/Cocoa.framework/
Headers/Cocoa.h:12,
from /Users/andreas/Q/myqemu/cocoa.m:38:
/System/Library/Frameworks/Foundation.framework/Headers/NSSet.h:45: error: parse error before "__attribute__"
/System/Library/Frameworks/Foundation.framework/Headers/NSSet.h:50: error: parse error before "__attribute__"
In file included from /System/Library/Frameworks/AppKit.framework/Headers/AppKit.h:19,
from /System/Library/Frameworks/Cocoa.framework/
Headers/Cocoa.h:13,
from /Users/andreas/Q/myqemu/cocoa.m:38:
/System/Library/Frameworks/AppKit.framework/Headers/NSApplication.h:68: error: parse error before "__weak"
In file included from /System/Library/Frameworks/AppKit.framework/Headers/AppKit.h:78,
from /System/Library/Frameworks/Cocoa.framework/
Headers/Cocoa.h:13,
from /Users/andreas/Q/myqemu/cocoa.m:38:
/System/Library/Frameworks/AppKit.framework/Headers/NSPrintPanel.h:57: error: parse error before '@' token
In file included from /System/Library/Frameworks/AppKit.framework/Headers/AppKit.h:95,
from /System/Library/Frameworks/Cocoa.framework/
Headers/Cocoa.h:13,
from /Users/andreas/Q/myqemu/cocoa.m:38:
/System/Library/Frameworks/AppKit.framework/Headers/NSTrackingArea.h:44: error: parse error before "__weak"
In file included from /System/Library/Frameworks/AppKit.framework/Headers/NSTextView.h:16,
from /System/Library/Frameworks/AppKit.framework/
Headers/AppKit.h:112,
from /System/Library/Frameworks/Cocoa.framework/
Headers/Cocoa.h:13,
from /Users/andreas/Q/myqemu/cocoa.m:38:
/System/Library/Frameworks/AppKit.framework/Headers/NSTextInputClient.h:17: error: parse error before '@' token
/System/Library/Frameworks/AppKit.framework/Headers/NSTextInputClient.h:62: error: parse error before '@' token
In file included from /System/Library/Frameworks/AppKit.framework/Headers/NSObjectController.h:10,
from /System/Library/Frameworks/AppKit.framework/
Headers/AppKit.h:158,
from /System/Library/Frameworks/Cocoa.framework/
Headers/Cocoa.h:13,
from /Users/andreas/Q/myqemu/cocoa.m:38:
/System/Library/Frameworks/CoreData.framework/Headers/NSFetchRequest.h:24: error: parse error before "__weak"
In file included from /System/Library/Frameworks/CoreData.framework/Headers/NSAttributeDescription.h:10,
from /System/Library/Frameworks/AppKit.framework/
Headers/NSPredicateEditorRowTemplate.h:13,
from /System/Library/Frameworks/AppKit.framework/
Headers/AppKit.h:175,
from /System/Library/Frameworks/Cocoa.framework/
Headers/Cocoa.h:13,
from /Users/andreas/Q/myqemu/cocoa.m:38:
/System/Library/Frameworks/CoreData.framework/Headers/NSPropertyDescription.h:25: error: parse error before "__weak"
In file included from /System/Library/Frameworks/AppKit.framework/Headers/AppKit.h:176,
from /System/Library/Frameworks/Cocoa.framework/
Headers/Cocoa.h:13,
from /Users/andreas/Q/myqemu/cocoa.m:38:
/System/Library/Frameworks/AppKit.framework/Headers/NSPathCell.h:148: error: parse error before '@' token
In file included from /System/Library/Frameworks/AppKit.framework/Headers/AppKit.h:177,
from /System/Library/Frameworks/Cocoa.framework/
Headers/Cocoa.h:13,
from /Users/andreas/Q/myqemu/cocoa.m:38:
/System/Library/Frameworks/AppKit.framework/Headers/NSPathControl.h:73: error: parse error before '@' token
In file included from /System/Library/Frameworks/CoreData.framework/Headers/CoreData.h:14,
from /System/Library/Frameworks/Cocoa.framework/
Headers/Cocoa.h:14,
from /Users/andreas/Q/myqemu/cocoa.m:38:
/System/Library/Frameworks/CoreData.framework/Headers/NSEntityDescription.h:28: error: parse error before "__weak"
/System/Library/Frameworks/CoreData.framework/Headers/NSEntityDescription.h:32: error: parse error before "__weak"
In file included from /System/Library/Frameworks/CoreData.framework/Headers/CoreData.h:17,
from /System/Library/Frameworks/Cocoa.framework/
Headers/Cocoa.h:14,
from /Users/andreas/Q/myqemu/cocoa.m:38:
/System/Library/Frameworks/CoreData.framework/Headers/NSRelationshipDescription.h:28: error: parse error before "__weak"
In file included from /System/Library/Frameworks/CoreData.framework/Headers/CoreData.h:22,
from /System/Library/Frameworks/Cocoa.framework/
Headers/Cocoa.h:14,
from /Users/andreas/Q/myqemu/cocoa.m:38:
/System/Library/Frameworks/CoreData.framework/Headers/NSManagedObject.h:26: error: parse error before "__weak"
In file included from /System/Library/Frameworks/CoreData.framework/Headers/CoreData.h:27,
from /System/Library/Frameworks/Cocoa.framework/
Headers/Cocoa.h:14,
from /Users/andreas/Q/myqemu/cocoa.m:38:
/System/Library/Frameworks/CoreData.framework/Headers/NSPersistentStore.h:16: error: parse error before "__weak"
In file included from /Users/andreas/Q/myqemu/target-sparc/cpu.h:20,

                 from /Users/andreas/Q/myqemu/vl.h:85,
                 from /Users/andreas/Q/myqemu/cocoa.m:40:

/Users/andreas/Q/myqemu/fpu/softfloat.h:51: warning: redefinition of uint8' /System/Library/Frameworks/Security.framework/Headers/cssmconfig.h:72: warning: uint8' previously declared here /Users/andreas/Q/myqemu/fpu/softfloat.h:53: error: conflicting types for uint16' /System/Library/Frameworks/Security.framework/Headers/cssmconfig.h:68: error: previous declaration of uint16' /Users/andreas/Q/myqemu/fpu/softfloat.h:55: warning: redefinition of uint32' /System/Library/Frameworks/Security.framework/Headers/cssmconfig.h:64: warning: uint32' previously declared here /Users/andreas/Q/myqemu/fpu/softfloat.h:57: warning: redefinition of uint64' /System/Library/Frameworks/Security.framework/Headers/cssmconfig.h:48: warning: uint64' previously declared here /Users/andreas/Q/myqemu/cocoa.m: In function `setApplicationMenu':
/Users/andreas/Q/myqemu/cocoa.m:860: warning: cannot find method -setAppleMenu:'; return type id' assumed make[1]: *** [cocoa.o] Error 1

Do you have a workaround for this as well?

Andreas

#4 lore raw
Quoted 10 lines · Andreas Färber

Am 12.12.2007 um 13:08 schrieb Alexander Graf:

Quoted 1 line

Does it work if you specify "-framework CoreFoundation -framework IOKit" in your LDFLAGS? That's what was needed on my Leopard x86_64 build.

If I configure with LDFLAGS:
LDFLAGS="-framework CoreFoundation -framework IOKit" ./configure --prefix=/Users/andreas/Q/latest --target-list=sparc-softmmu --enable-cocoa it now ends like this:

gcc-3.3 -Wall -O2 -g -fno-strict-aliasing -I. -I.. -I/Users/andreas/Q/myqemu/target-sparc -I/Users/andreas/Q/myqemu -D__powerpc__ -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -I/Users/andreas/Q/myqemu/fpu -I/Users/andreas/Q/myqemu/slirp

the -framework flags are missing here

Quoted 115 lines

-mdynamic-no-pic -c -o cocoa.o /Users/andreas/Q/myqemu/cocoa.m
In file included from /System/Library/Frameworks/Foundation.framework/Headers/Foundation.h:15,
from /System/Library/Frameworks/Cocoa.framework/
Headers/Cocoa.h:12,
from /Users/andreas/Q/myqemu/cocoa.m:38:
/System/Library/Frameworks/Foundation.framework/Headers/NSArray.h:62: error: parse error before "__attribute__" /System/Library/Frameworks/Foundation.framework/Headers/NSArray.h:66: error: parse error before "__attribute__" In file included from /System/Library/Frameworks/Foundation.framework/Headers/NSAttributedString.h:6,
from /System/Library/Frameworks/Foundation.framework/
Headers/Foundation.h:16,
from /System/Library/Frameworks/Cocoa.framework/
Headers/Cocoa.h:12,
from /Users/andreas/Q/myqemu/cocoa.m:38:
/System/Library/Frameworks/Foundation.framework/Headers/NSDictionary.h:45: error: parse error before "__attribute__" /System/Library/Frameworks/Foundation.framework/Headers/NSDictionary.h:50: error: parse error before "__attribute__" In file included from /System/Library/Frameworks/Foundation.framework/Headers/NSHashTable.h:5,
from /System/Library/Frameworks/Foundation.framework/
Headers/Foundation.h:43,
from /System/Library/Frameworks/Cocoa.framework/
Headers/Cocoa.h:12,
from /Users/andreas/Q/myqemu/cocoa.m:38:
/System/Library/Frameworks/Foundation.framework/Headers/NSPointerFunctions.h:59: error: parse error before '@' token In file included from /System/Library/Frameworks/Foundation.framework/Headers/NSKeyValueCoding.h:9,
from /System/Library/Frameworks/Foundation.framework/
Headers/Foundation.h:49,
from /System/Library/Frameworks/Cocoa.framework/
Headers/Cocoa.h:12,
from /Users/andreas/Q/myqemu/cocoa.m:38:
/System/Library/Frameworks/Foundation.framework/Headers/NSSet.h:45: error: parse error before "__attribute__" /System/Library/Frameworks/Foundation.framework/Headers/NSSet.h:50: error: parse error before "__attribute__" In file included from /System/Library/Frameworks/AppKit.framework/Headers/AppKit.h:19,
from /System/Library/Frameworks/Cocoa.framework/
Headers/Cocoa.h:13,
from /Users/andreas/Q/myqemu/cocoa.m:38:
/System/Library/Frameworks/AppKit.framework/Headers/NSApplication.h:68: error: parse error before "__weak" In file included from /System/Library/Frameworks/AppKit.framework/Headers/AppKit.h:78,
from /System/Library/Frameworks/Cocoa.framework/
Headers/Cocoa.h:13,
from /Users/andreas/Q/myqemu/cocoa.m:38:
/System/Library/Frameworks/AppKit.framework/Headers/NSPrintPanel.h:57: error: parse error before '@' token In file included from /System/Library/Frameworks/AppKit.framework/Headers/AppKit.h:95,
from /System/Library/Frameworks/Cocoa.framework/
Headers/Cocoa.h:13,
from /Users/andreas/Q/myqemu/cocoa.m:38:
/System/Library/Frameworks/AppKit.framework/Headers/NSTrackingArea.h:44: error: parse error before "__weak" In file included from /System/Library/Frameworks/AppKit.framework/Headers/NSTextView.h:16,
from /System/Library/Frameworks/AppKit.framework/
Headers/AppKit.h:112,
from /System/Library/Frameworks/Cocoa.framework/
Headers/Cocoa.h:13,
from /Users/andreas/Q/myqemu/cocoa.m:38:
/System/Library/Frameworks/AppKit.framework/Headers/NSTextInputClient.h:17: error: parse error before '@' token /System/Library/Frameworks/AppKit.framework/Headers/NSTextInputClient.h:62: error: parse error before '@' token In file included from /System/Library/Frameworks/AppKit.framework/Headers/NSObjectController.h:10,
from /System/Library/Frameworks/AppKit.framework/
Headers/AppKit.h:158,
from /System/Library/Frameworks/Cocoa.framework/
Headers/Cocoa.h:13,
from /Users/andreas/Q/myqemu/cocoa.m:38:
/System/Library/Frameworks/CoreData.framework/Headers/NSFetchRequest.h:24: error: parse error before "__weak" In file included from /System/Library/Frameworks/CoreData.framework/Headers/NSAttributeDescription.h:10,
from /System/Library/Frameworks/AppKit.framework/
Headers/NSPredicateEditorRowTemplate.h:13,
from /System/Library/Frameworks/AppKit.framework/
Headers/AppKit.h:175,
from /System/Library/Frameworks/Cocoa.framework/
Headers/Cocoa.h:13,
from /Users/andreas/Q/myqemu/cocoa.m:38:
/System/Library/Frameworks/CoreData.framework/Headers/NSPropertyDescription.h:25: error: parse error before "__weak" In file included from /System/Library/Frameworks/AppKit.framework/Headers/AppKit.h:176,
from /System/Library/Frameworks/Cocoa.framework/
Headers/Cocoa.h:13,
from /Users/andreas/Q/myqemu/cocoa.m:38:
/System/Library/Frameworks/AppKit.framework/Headers/NSPathCell.h:148: error: parse error before '@' token In file included from /System/Library/Frameworks/AppKit.framework/Headers/AppKit.h:177,
from /System/Library/Frameworks/Cocoa.framework/
Headers/Cocoa.h:13,
from /Users/andreas/Q/myqemu/cocoa.m:38:
/System/Library/Frameworks/AppKit.framework/Headers/NSPathControl.h:73: error: parse error before '@' token In file included from /System/Library/Frameworks/CoreData.framework/Headers/CoreData.h:14,
from /System/Library/Frameworks/Cocoa.framework/
Headers/Cocoa.h:14,
from /Users/andreas/Q/myqemu/cocoa.m:38:
/System/Library/Frameworks/CoreData.framework/Headers/NSEntityDescription.h:28: error: parse error before "__weak" /System/Library/Frameworks/CoreData.framework/Headers/NSEntityDescription.h:32: error: parse error before "__weak" In file included from /System/Library/Frameworks/CoreData.framework/Headers/CoreData.h:17,
from /System/Library/Frameworks/Cocoa.framework/
Headers/Cocoa.h:14,
from /Users/andreas/Q/myqemu/cocoa.m:38:
/System/Library/Frameworks/CoreData.framework/Headers/NSRelationshipDescription.h:28: error: parse error before "__weak" In file included from /System/Library/Frameworks/CoreData.framework/Headers/CoreData.h:22,
from /System/Library/Frameworks/Cocoa.framework/
Headers/Cocoa.h:14,
from /Users/andreas/Q/myqemu/cocoa.m:38:
/System/Library/Frameworks/CoreData.framework/Headers/NSManagedObject.h:26: error: parse error before "__weak" In file included from /System/Library/Frameworks/CoreData.framework/Headers/CoreData.h:27,
from /System/Library/Frameworks/Cocoa.framework/
Headers/Cocoa.h:14,
from /Users/andreas/Q/myqemu/cocoa.m:38:
/System/Library/Frameworks/CoreData.framework/Headers/NSPersistentStore.h:16: error: parse error before "__weak" In file included from /Users/andreas/Q/myqemu/target-sparc/cpu.h:20,

                from /Users/andreas/Q/myqemu/vl.h:85,
                from /Users/andreas/Q/myqemu/cocoa.m:40:

/Users/andreas/Q/myqemu/fpu/softfloat.h:51: warning: redefinition of uint8' /System/Library/Frameworks/Security.framework/Headers/cssmconfig.h:72: warning: uint8' previously declared here /Users/andreas/Q/myqemu/fpu/softfloat.h:53: error: conflicting types for uint16' /System/Library/Frameworks/Security.framework/Headers/cssmconfig.h:68: error: previous declaration of uint16' /Users/andreas/Q/myqemu/fpu/softfloat.h:55: warning: redefinition of uint32' /System/Library/Frameworks/Security.framework/Headers/cssmconfig.h:64: warning: uint32' previously declared here /Users/andreas/Q/myqemu/fpu/softfloat.h:57: warning: redefinition of uint64' /System/Library/Frameworks/Security.framework/Headers/cssmconfig.h:48: warning: uint64' previously declared here /Users/andreas/Q/myqemu/cocoa.m: In function `setApplicationMenu':
/Users/andreas/Q/myqemu/cocoa.m:860: warning: cannot find method -setAppleMenu:'; return type id' assumed make[1]: *** [cocoa.o] Error 1

Quoted 2 lines

Do you have a workaround for this as well?

I put the -framework definitions in ARCH_LDFLAGS. Basically what you could do to reproduce that is

1. run configure normally
2. edit config-host.mak
3. add the -framework flags to ARCH_LDFLAGS

If that doesn't work, copy the above gcc line and add the flags manually. Make should find the file as compiled afterwards and you can at least complete the build.

Is this on Mac OS X PPC? My iBook is broken right now, so I can't really check if any of this works. You can always compile qemu without cocoa, using only vnc as output and have no framework dependencies then.

Quoted 3 lines

Andreas

#5 lore raw

Am 14.12.2007 um 12:24 schrieb Alexander Graf:

Quoted 8 lines · Andreas Färber
Quoted 6 lines

Am 12.12.2007 um 13:08 schrieb Alexander Graf:

Quoted 1 line

Does it work if you specify "-framework CoreFoundation -framework IOKit" in your LDFLAGS? That's what was needed on my Leopard x86_64 build.

Quoted 7 lines
Quoted 5 lines

If I configure with LDFLAGS:
LDFLAGS="-framework CoreFoundation -framework IOKit" ./configure --prefix=/Users/andreas/Q/latest --target-list=sparc-softmmu --enable-cocoa it now ends like this:

gcc-3.3 -Wall -O2 -g -fno-strict-aliasing -I. -I.. -I/Users/andreas/Q/myqemu/target-sparc -I/Users/andreas/Q/myqemu -D__powerpc__ -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -I/Users/andreas/Q/myqemu/fpu -I/Users/andreas/Q/myqemu/slirp

the -framework flags are missing here

No, this is an unrelated compilation of an .o file; LDFLAGS are used when linking the object files to an executable. ARCH_LDFLAGS has no influence here.

Quoted 121 lines
Quoted 116 lines

-mdynamic-no-pic -c -o cocoa.o /Users/andreas/Q/myqemu/cocoa.m
In file included from /System/Library/Frameworks/Foundation.framework/Headers/Foundation.h:15,
from /System/Library/Frameworks/Cocoa.framework/
Headers/Cocoa.h:12,
from /Users/andreas/Q/myqemu/cocoa.m:38:
/System/Library/Frameworks/Foundation.framework/Headers/NSArray.h:62: error: parse error before "__attribute__" /System/Library/Frameworks/Foundation.framework/Headers/NSArray.h:66: error: parse error before "__attribute__" In file included from /System/Library/Frameworks/Foundation.framework/Headers/NSAttributedString.h:6,
from /System/Library/Frameworks/Foundation.framework/
Headers/Foundation.h:16,
from /System/Library/Frameworks/Cocoa.framework/
Headers/Cocoa.h:12,
from /Users/andreas/Q/myqemu/cocoa.m:38:
/System/Library/Frameworks/Foundation.framework/Headers/NSDictionary.h:45: error: parse error before "__attribute__" /System/Library/Frameworks/Foundation.framework/Headers/NSDictionary.h:50: error: parse error before "__attribute__" In file included from /System/Library/Frameworks/Foundation.framework/Headers/NSHashTable.h:5,
from /System/Library/Frameworks/Foundation.framework/
Headers/Foundation.h:43,
from /System/Library/Frameworks/Cocoa.framework/
Headers/Cocoa.h:12,
from /Users/andreas/Q/myqemu/cocoa.m:38:
/System/Library/Frameworks/Foundation.framework/Headers/NSPointerFunctions.h:59: error: parse error before '@' token In file included from /System/Library/Frameworks/Foundation.framework/Headers/NSKeyValueCoding.h:9,
from /System/Library/Frameworks/Foundation.framework/
Headers/Foundation.h:49,
from /System/Library/Frameworks/Cocoa.framework/
Headers/Cocoa.h:12,
from /Users/andreas/Q/myqemu/cocoa.m:38:
/System/Library/Frameworks/Foundation.framework/Headers/NSSet.h:45: error: parse error before "__attribute__" /System/Library/Frameworks/Foundation.framework/Headers/NSSet.h:50: error: parse error before "__attribute__" In file included from /System/Library/Frameworks/AppKit.framework/Headers/AppKit.h:19,
from /System/Library/Frameworks/Cocoa.framework/
Headers/Cocoa.h:13,
from /Users/andreas/Q/myqemu/cocoa.m:38:
/System/Library/Frameworks/AppKit.framework/Headers/NSApplication.h:68: error: parse error before "__weak" In file included from /System/Library/Frameworks/AppKit.framework/Headers/AppKit.h:78,
from /System/Library/Frameworks/Cocoa.framework/
Headers/Cocoa.h:13,
from /Users/andreas/Q/myqemu/cocoa.m:38:
/System/Library/Frameworks/AppKit.framework/Headers/NSPrintPanel.h:57: error: parse error before '@' token In file included from /System/Library/Frameworks/AppKit.framework/Headers/AppKit.h:95,
from /System/Library/Frameworks/Cocoa.framework/
Headers/Cocoa.h:13,
from /Users/andreas/Q/myqemu/cocoa.m:38:
/System/Library/Frameworks/AppKit.framework/Headers/NSTrackingArea.h:44: error: parse error before "__weak" In file included from /System/Library/Frameworks/AppKit.framework/Headers/NSTextView.h:16,
from /System/Library/Frameworks/AppKit.framework/
Headers/AppKit.h:112,
from /System/Library/Frameworks/Cocoa.framework/
Headers/Cocoa.h:13,
from /Users/andreas/Q/myqemu/cocoa.m:38:
/System/Library/Frameworks/AppKit.framework/Headers/NSTextInputClient.h:17: error: parse error before '@' token /System/Library/Frameworks/AppKit.framework/Headers/NSTextInputClient.h:62: error: parse error before '@' token In file included from /System/Library/Frameworks/AppKit.framework/Headers/NSObjectController.h:10,
from /System/Library/Frameworks/AppKit.framework/
Headers/AppKit.h:158,
from /System/Library/Frameworks/Cocoa.framework/
Headers/Cocoa.h:13,
from /Users/andreas/Q/myqemu/cocoa.m:38:
/System/Library/Frameworks/CoreData.framework/Headers/NSFetchRequest.h:24: error: parse error before "__weak" In file included from /System/Library/Frameworks/CoreData.framework/Headers/NSAttributeDescription.h:10,
from /System/Library/Frameworks/AppKit.framework/
Headers/NSPredicateEditorRowTemplate.h:13,
from /System/Library/Frameworks/AppKit.framework/
Headers/AppKit.h:175,
from /System/Library/Frameworks/Cocoa.framework/
Headers/Cocoa.h:13,
from /Users/andreas/Q/myqemu/cocoa.m:38:
/System/Library/Frameworks/CoreData.framework/Headers/NSPropertyDescription.h:25: error: parse error before "__weak" In file included from /System/Library/Frameworks/AppKit.framework/Headers/AppKit.h:176,
from /System/Library/Frameworks/Cocoa.framework/
Headers/Cocoa.h:13,
from /Users/andreas/Q/myqemu/cocoa.m:38:
/System/Library/Frameworks/AppKit.framework/Headers/NSPathCell.h:148: error: parse error before '@' token In file included from /System/Library/Frameworks/AppKit.framework/Headers/AppKit.h:177,
from /System/Library/Frameworks/Cocoa.framework/
Headers/Cocoa.h:13,
from /Users/andreas/Q/myqemu/cocoa.m:38:
/System/Library/Frameworks/AppKit.framework/Headers/NSPathControl.h:73: error: parse error before '@' token In file included from /System/Library/Frameworks/CoreData.framework/Headers/CoreData.h:14,
from /System/Library/Frameworks/Cocoa.framework/
Headers/Cocoa.h:14,
from /Users/andreas/Q/myqemu/cocoa.m:38:
/System/Library/Frameworks/CoreData.framework/Headers/NSEntityDescription.h:28: error: parse error before "__weak" /System/Library/Frameworks/CoreData.framework/Headers/NSEntityDescription.h:32: error: parse error before "__weak" In file included from /System/Library/Frameworks/CoreData.framework/Headers/CoreData.h:17,
from /System/Library/Frameworks/Cocoa.framework/
Headers/Cocoa.h:14,
from /Users/andreas/Q/myqemu/cocoa.m:38:
/System/Library/Frameworks/CoreData.framework/Headers/NSRelationshipDescription.h:28: error: parse error before "__weak" In file included from /System/Library/Frameworks/CoreData.framework/Headers/CoreData.h:22,
from /System/Library/Frameworks/Cocoa.framework/
Headers/Cocoa.h:14,
from /Users/andreas/Q/myqemu/cocoa.m:38:
/System/Library/Frameworks/CoreData.framework/Headers/NSManagedObject.h:26: error: parse error before "__weak" In file included from /System/Library/Frameworks/CoreData.framework/Headers/CoreData.h:27,
from /System/Library/Frameworks/Cocoa.framework/
Headers/Cocoa.h:14,
from /Users/andreas/Q/myqemu/cocoa.m:38:
/System/Library/Frameworks/CoreData.framework/Headers/NSPersistentStore.h:16: error: parse error before "__weak" In file included from /Users/andreas/Q/myqemu/target-sparc/cpu.h:20,

               from /Users/andreas/Q/myqemu/vl.h:85,
               from /Users/andreas/Q/myqemu/cocoa.m:40:

/Users/andreas/Q/myqemu/fpu/softfloat.h:51: warning: redefinition of uint8' /System/Library/Frameworks/Security.framework/Headers/cssmconfig.h:72: warning: uint8' previously declared here /Users/andreas/Q/myqemu/fpu/softfloat.h:53: error: conflicting types for uint16' /System/Library/Frameworks/Security.framework/Headers/cssmconfig.h:68: error: previous declaration of uint16' /Users/andreas/Q/myqemu/fpu/softfloat.h:55: warning: redefinition of uint32' /System/Library/Frameworks/Security.framework/Headers/cssmconfig.h:64: warning: uint32' previously declared here /Users/andreas/Q/myqemu/fpu/softfloat.h:57: warning: redefinition of uint64' /System/Library/Frameworks/Security.framework/Headers/cssmconfig.h:48: warning: uint64' previously declared here /Users/andreas/Q/myqemu/cocoa.m: In function `setApplicationMenu':
/Users/andreas/Q/myqemu/cocoa.m:860: warning: cannot find method -setAppleMenu:'; return type id' assumed make[1]: *** [cocoa.o] Error 1

Quoted 2 lines

Do you have a workaround for this as well?

I put the -framework definitions in ARCH_LDFLAGS. Basically what you could do to reproduce that is

Quoted 7 lines

1. run configure normally
2. edit config-host.mak
3. add the -framework flags to ARCH_LDFLAGS

If that doesn't work, copy the above gcc line and add the flags manually. Make should find the file as compiled afterwards and you can at least complete the build.

Is this on Mac OS X PPC? My iBook is broken right now, so I can't really check if any of this works. You can always compile qemu without cocoa, using only vnc as output and have no framework dependencies then.

This is on Leopard ppc. I went back up to 20071001 and I still get the same compilation problem, which didn't surface in Tiger back then (and I didn't need to set any LDFLAGS there). This is really puzzling!

It looks like a conflict between QEMU's and the system's definitions, no?

I always needed to add --enable-cocoa to configure, otherwise configure aborts complaining about SDL not being present. If I do --disable-sdl it still adds Cocoa support, and there is no --disable-cocoa. The only VNC option I see is disabling TLS.

Andreas

#6 lore raw
Quoted 15 lines · Andreas Färber

Am 14.12.2007 um 12:24 schrieb Alexander Graf:

Quoted 12 lines · Andreas Färber
Quoted 10 lines

Am 12.12.2007 um 13:08 schrieb Alexander Graf:

Quoted 1 line

Does it work if you specify "-framework CoreFoundation -framework IOKit" in your LDFLAGS? That's what was needed on my Leopard x86_64 build.

If I configure with LDFLAGS:
LDFLAGS="-framework CoreFoundation -framework IOKit" ./configure --prefix=/Users/andreas/Q/latest --target-list=sparc-softmmu --enable-cocoa it now ends like this:

Quoted 5 lines
Quoted 3 lines
Quoted 1 line

gcc-3.3 -Wall -O2 -g -fno-strict-aliasing -I. -I.. -I/Users/andreas/Q/myqemu/target-sparc -I/Users/andreas/Q/myqemu -D__powerpc__ -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -I/Users/andreas/Q/myqemu/fpu -I/Users/andreas/Q/myqemu/slirp

the -framework flags are missing here

No, this is an unrelated compilation of an .o file; LDFLAGS are used when linking the object files to an executable. ARCH_LDFLAGS has no influence here.

Yes, you're right. I did not see that.

Quoted 15 lines
Quoted 15 lines
Quoted 15 lines

-mdynamic-no-pic -c -o cocoa.o /Users/andreas/Q/myqemu/cocoa.m
In file included from /System/Library/Frameworks/Foundation.framework/Headers/Foundation.h:15,
from /System/Library/Frameworks/Cocoa.framework/
Headers/Cocoa.h:12,
from /Users/andreas/Q/myqemu/cocoa.m:38:
/System/Library/Frameworks/Foundation.framework/Headers/NSArray.h:62: error: parse error before "__attribute__" /System/Library/Frameworks/Foundation.framework/Headers/NSArray.h:66: error: parse error before "__attribute__" In file included from /System/Library/Frameworks/Foundation.framework/Headers/NSAttributedString.h:6,
from /System/Library/Frameworks/Foundation.framework/
Headers/Foundation.h:16,
from /System/Library/Frameworks/Cocoa.framework/
Headers/Cocoa.h:12,

[...]

Quoted 10 lines
Quoted 10 lines
Quoted 3 lines

Do you have a workaround for this as well?

I put the -framework definitions in ARCH_LDFLAGS. Basically what you could do to reproduce that is

1. run configure normally
2. edit config-host.mak
3. add the -framework flags to ARCH_LDFLAGS

Quoted 5 lines
Quoted 3 lines

If that doesn't work, copy the above gcc line and add the flags manually. Make should find the file as compiled afterwards and you can at least complete the build.

Is this on Mac OS X PPC? My iBook is broken right now, so I can't really check if any of this works. You can always compile qemu without cocoa, using only vnc as output and have no framework dependencies then.

This is on Leopard ppc. I went back up to 20071001 and I still get the same compilation problem, which didn't surface in Tiger back then (and I didn't need to set any LDFLAGS there). This is really puzzling!

Sounds like a Leopard problem then. -framework adds not only the Library path (-L) of the framework, but also the header path (-I) to the build. So maybe a -framework xxx would still help here. I can only tell you that I have seen that problem on x86_64 as well and I did fix it locally. I just can't remember how exactly I did it and it's somewhere deep inside dark and gloomy git trees right now.

Quoted 6 lines

It looks like a conflict between QEMU's and the system's definitions, no?

I always needed to add --enable-cocoa to configure, otherwise configure aborts complaining about SDL not being present. If I do --disable-sdl it still adds Cocoa support, and there is no --disable-cocoa. The only VNC option I see is disabling TLS.

You can patch the configure script to not use cocoa (there is a cocoa=yes line somewhere) and coreaudio, even if the system is darwin. Do a --disable-sdl then and a --disable-gfx-check and it _should_ compile. See my first x86_64 osx patch for the places. I did remove cocoa support for x86_64 there.

Cheers,

Alex

#7 lore raw
In reply to Alexander Graf

Am 12.12.2007 um 13:08 schrieb Alexander Graf:

Quoted 25 lines · Andreas Färber
Quoted 22 lines

Am 11.11.2007 um 13:40 schrieb Andreas Färber:

Quoted 17 lines

Building CVS HEAD on OS X (here sparc-softmmu) currently results in unresolved symbols:

gcc-3.3 -g -o qemu-img qemu-img.o qemu-img-block.o qemu-img-block-raw.o cutils.o block-cow.o block-qcow.o aes.o block-vmdk.o block-cloop.o block-dmg.o block-bochs.o block-vpc.o block-vvfat.o block-qcow2.o block-parallels.o -lz
ld: Undefined symbols:
_CFDictionarySetValue
_CFRelease
_CFStringGetCString
_IOIteratorNext
_IOMasterPort
_IOObjectRelease
_IORegistryEntryCreateCFProperty
_IOServiceGetMatchingServices
_IOServiceMatching
___CFStringMakeConstantString
_kCFAllocatorDefault
_kCFBooleanTrue
make: *** [qemu-img] Error 1

Quoted 1 line

Does it work if you specify "-framework CoreFoundation -framework IOKit" in your LDFLAGS? That's what was needed on my Leopard x86_64 build.

The attached patch fixes the above build problem by adding -framework CoreFoundation -framework IOKit to LDFLAGS, as suggested by Alexander.

Andreas

Index: configure
===================================================================
RCS file: /sources/qemu/qemu/configure,v
retrieving revision 1.178

configure +1 -0
diff -u -r1.178 configure
@@ -151,6 +151,7 @@
 cocoa="yes"
 coreaudio="yes"
 OS_CFLAGS="-mdynamic-no-pic"
+OS_LDFLAGS="-framework CoreFoundation -framework IOKit"
 ;;
 SunOS)
     solaris="yes"