bugGNU libunistring - Bugs: bug #37751, build on OS X 10.8 with Xcode-only


You are not allowed to post comments on this tracker with your current authentication level.

bug #37751: build on OS X 10.8 with Xcode-only

Submitted by:  None
Submitted on:  Thu 15 Nov 2012 04:15:35 PM UTC  
Category: BuildSeverity: 3 - Normal
Item Group: NoneStatus: Fixed
Privacy: PublicAssigned to: Bruno Haible <haible>
Open/Closed: Closed

Fri 09 Dec 2016 11:46:41 PM UTC, comment #2:

Thanks for the report. Yes, removing the "#define _UINT64_T" appears to makes things work. This change was committed in http://git.savannah.gnu.org/gitweb/?p=libunistring.git;a=commitdiff;h=c8337fee8bd30207245f67201a9b4559f10ca91c and is contained in libunistring 0.9.4 and newer.

Bruno Haible <haible>
Project AdministratorIn charge of this item.
Thu 15 Nov 2012 06:04:09 PM UTC, comment #1:

was submitted by me. (samuel_john)

Samuel John <samuel_john>
Thu 15 Nov 2012 04:15:35 PM UTC, original submission:

version: 0.9.3
OS version: 10.8.x (probably 10.7, too)

tl;dr Could you remove or guard three lines in the stdint.mini.h so that UINT64_T, _UINT32_T and _UINT8_T are _not defined on OS X? See attached patch.

### Into
Since Apple started to remove the compiler toolchain from a freshly installed OS X, Homebrew supports building software with the toolchain provided by Xcode. This toolchain is not located at /usr but at some other (longer path).

### configure
Therefore stdint.h and others are not at /usr/include but at /Applications/Xcode.app/.../usr/include. Configure reports HAVE_STDINT_H = 1 but I saw some hard coded /usr/include/stdint.h tests. Not sure here. But that's not the point. Homebrew adds via the --sysroot switch the correct path and indeed the stdint.h is found successfully.

### stdint.mini.h
However the stdint.mini.h of libunistring seems to define some stuff before the system's stdint.h is included and especially defines _UINT64_T and so the uint64_t from the system's stdint.h is no longer defined (there is a `#ifndef`).

### Possible Solution
Libunistring does no typedef but defines the macro like so:

/* Avoid collision with Solaris 2.5.1 <pthread.h> etc. */
#define _UINT8_T
#define _UINT32_T
#define _UINT64_T

For homebrew, I just removed these three and the build succeeds.

### Question
Could you remove or guard these lines so they are not defined on OS X ?
Or do you think something other went wrong and the stdint.mini.h should not have been used in the first place (on OS X)?
How can I tell libunistring to use the stdint.h from OS X? (The compiler finds it but the local ./stdint.h takes precedence)



Attached Files
file #26918:  libunistring_osx_xcode_only_patch.diff added by None (507B - application/octet-stream - The patch, I wrote for Homebrew to make it compile.)


Depends on the following items: None found

Items that depend on this one: None found


Carbon-Copy List
  • -unavailable- added by haible (Updated the item)
  • -unavailable- added by samuel_john (Posted a comment)
  • -unavailable- added by samuel_john (creator now has a savannah account)

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.


    Please enter the title of George Orwell's famous dystopian book (it's a date):



    Follow 6 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Fri 09 Dec 2016 11:46:41 PM UTChaibleStatusNone=>Fixed
      Assigned toNone=>haible
    Thu 24 Nov 2016 12:28:54 AM UTChaibleCategoryNone=>Build
    Thu 15 Nov 2012 06:03:16 PM UTCsamuel_johnCarbon-Copy-=>Added samuel_john
    Thu 15 Nov 2012 04:15:35 PM UTCNoneAttached File-=>Added libunistring_osx_xcode_only_patch.diff, #26918

    Back to the top

    Powered by Savane 3.1-cleanup1