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

Submitter:  None
Submitted:  Thu 15 Nov 2012 04:15:35 PM UTC
   
 
Category:  Build Severity:  3 - Normal
Item Group:  None Status:  Fix Released
Privacy:  Public Assigned to:  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>
Group administrator
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)



Anonymous

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

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
  • -email is unavailable- added by haible (Updated the item)
  • -email is unavailable- added by samuel_john (Posted a comment)
  • -email is unavailable- added by samuel_john (creator now has a savannah account)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

     

    Follow 7 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2023-01-04 haible StatusFixed Fix Released
    2016-12-09 haible StatusNone Fixed
        Assigned toNone haible
        Open/ClosedOpen Closed
    2016-11-24 haible CategoryNone Build
    2012-11-15 samuel_john Carbon-Copy- Added samuel_john
    2012-11-15 None Attached File- Added libunistring_osx_xcode_only_patch.diff, #26918

    Back to the top

    Powered by Savane 3.13-d3ae.
    Corresponding source code