• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: moving from Xcode 2.5 -> 3.1: problem building a USB kernel driver
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: moving from Xcode 2.5 -> 3.1: problem building a USB kernel driver


  • Subject: Re: moving from Xcode 2.5 -> 3.1: problem building a USB kernel driver
  • From: Eric Gorouben <email@hidden>
  • Date: Sun, 3 Aug 2008 23:26:45 +0200

Hi Fritz,

Thanks for the quick reply,

I didn't say much, you're right, because the problem seemed more related to the difference between 2.5 & 3.1.
I'm building against 10.3.9 on ppc, 10.4u on i386
I build for 10.4u sdk using the macro SDKROOT_i386 = $ (DEVELOPER_SDK_DIR)/MacOSX10.4u.sdk
I build for 10.3.9 sdk using the macro SDKROOT_ppc = $ (DEVELOPER_SDK_DIR)/MacOSX10.3.9.sdk
On Xcode 2.5, (DEVELOPER_SDK_DIR) expands to /Xcode2.5/SDKs , on Xcode 3.1, it expands to /Developer/SDKs.


With the same project:

Xcode 2.5:
ARCHS = ppc i386
SDKROOT = $(DEVELOPER_SDK_DIR)/MacOSX10.4u.sdk
SYMROOT = /Xcode2.5/Builds
GCC_VERSION_i386 = 4.0
GCC_VERSION_ppc = 3.3
MACOSX_DEPLOYMENT_TARGET_i386 = 10.4
MACOSX_DEPLOYMENT_TARGET_ppc = 10.3
SDKROOT_i386 = $(DEVELOPER_SDK_DIR)/MacOSX10.4u.sdk
SDKROOT_ppc = $(DEVELOPER_SDK_DIR)/MacOSX10.3.9.sdk

Xcode 3.1
ADDITIONAL_SDKS =
ARCHS = ppc i386
SDKROOT = macosx10.4
ONLY_ACTIVE_ARCH = NO
VALID_ARCHS = i386 ppc ppc64 ppc7400 ppc970 x86_64
GCC_VERSION_i386 = 4.0
GCC_VERSION_ppc = 3.3
KERNEL_MODULE = YES
MACOSX_DEPLOYMENT_TARGET_i386 = 10.4
MACOSX_DEPLOYMENT_TARGET_ppc = 10.3
SDKROOT_i386 = $(DEVELOPER_SDK_DIR)/MacOSX10.4u.sdk
SDKROOT_ppc = $(DEVELOPER_SDK_DIR)/MacOSX10.3.9.sdk

Actually, you pointed out the right problem, since when I cmd-click on absolutetime_to_nanoseconds, Xcode 2.5 tells me the definition located in /Xcode2.5/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks/ Kernel.framework/Versions/A/Headers/kern/clock.h
while Xcode 3.1 tells me the 2 defs (function and macro) located in
/Developer/SDKs/MacOSX10.3.9.sdk/System/Library/Frameworks/ Kernel.framework/Versions/A/Headers/kern/clock.h
Obviously, the compiler chooses the macro def.


Then, my question is: is there any reason why Xcode 3.1 would not choose the right settings?
Thanks again
Eric



Le 3 août 08 à 21:57, Fritz Anderson a écrit :

On 3 Aug 2008, at 1:10 PM, Eric Gorouben wrote:

I'm building a USB kernel extension that uses absolutetime_to_nanoseconds.
With Xcode 2.5, no problem.
With Xcode 3.1, I get this error: error: conversion from 'uint64_t' to non-scalar type 'AbsoluteTime' requested


Why this difference between Xcode 2.5 and Xcode 3.1?
I suspect a change in some MACRO, but I can't find it anywhere.


You have not shared _any_ information about the code at which the error occurred, so I can only do half an hour's worth of your research for you, and then guess.

Apparently you are using different SDKs in the two versions of Xcode. This is a very bad idea.

In each of Xcode 2.5 and Xcode 3.0, hold down the command key and double-click on absolutetime_to_nanoseconds (the name does not appear in Xcode's API list). What is the declaration for absolutetime_to_nanoseconds in each case?

And what do you find, in each version, when you command-double-click on AbsoluteTime? I've found that in the 10.3.9 SDK, under some circumstances, absolutetime_to_nanoseconds is defined as a macro that takes an AbsoluteTime struct and does a simple pointer cast to turn it into a uint64_t. You are evidently passing a uint64_t type in (though I can't be sure of this, because you have not bothered to show any of your code).

The AbsoluteTime struct (actually a typedef for the UnsignedWide struct) depends on the byte order of its components. That is a disaster on machines with Intel processors, and the reason the API changed after 10.3.9.

If you intend to deploy only on 10.3.9, use the 10.3.9 SDK (it's an optional install on Xcode 3.x). If you intend to deploy on Intel at all, use the SDK for the highest version of the OS you intend to support.

	— F


_______________________________________________ Do not post admin requests to the list. They will be ignored. Xcode-users mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
References: 
 >moving from Xcode 2.5 -> 3.1: problem building a USB kernel driver (From: Eric Gorouben <email@hidden>)
 >Re: moving from Xcode 2.5 -> 3.1: problem building a USB kernel driver (From: Fritz Anderson <email@hidden>)

  • Prev by Date: Re: moving from Xcode 2.5 -> 3.1: problem building a USB kernel driver
  • Next by Date: Re: linking error?
  • Previous by thread: Re: moving from Xcode 2.5 -> 3.1: problem building a USB kernel driver
  • Next by thread: Optimal environment to compile C
  • Index(es):
    • Date
    • Thread