bugGNU libunistring - Bugs: bug #36057, Unable to compile...

 
 

bug #36057: Unable to compile libunistring-0.9.3 on Mac OS X 10.6.8

Submitted by:  Shane Celis <shizzy0>
Submitted on:  Sat 31 Mar 2012 07:57:48 PM UTC  
 
Category: NoneSeverity: 3 - Normal
Item Group: NoneStatus: Need Info
Privacy: PublicAssigned to: Bruno Haible <haible>
Open/Closed: Open

Add a New Comment (Rich MarkupRich Markup):
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Sun 01 Apr 2012 09:58:40 AM UTC, comment #3:

> Here's the error I was dealing with.


Thanks.

> Inside the u16-casemap.lo file (attached), here is the interesting bit:


Thanks, this reveals the first layer of the problem:

> #define UC_CATEGORY_C UC_CATEGORY_Cc UC_CATEGORY_Cf ...


In a correct build, these should be several lines, like this:

#define _UC_CATEGORY_NONE libunistring__UC_CATEGORY_NONE
#define C_isalnum libunistring_C_isalnum
#define C_isalpha libunistring_C_isalpha
...

This section ought to be constructed based on a file
lib/libunistring.sym.

Can you please attach
1) the file config.status
2) the file lib/libunistring.sym
3) the output of the commands
type sed; sed --version
type sort; sort --version
type uniq; uniq --version
type grep; grep --version
type join; join --version

Thanks.

Bruno Haible <haible>
Project AdministratorIn charge of this item.
Sat 31 Mar 2012 10:09:22 PM UTC, comment #2:

Right. Sorry. Here's the error I was dealing with.

$ ./configure && make
...
/bin/sh ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -DNO_XMALLOC -I. -I.. -I. -I. -I.. -I.. -DIN_LIBUNISTRING -DDEPENDS_ON_LIBICONV=1 -g -O2 -c -o unicase/u16-casefold.lo unicase/u16-casefold.c
libtool: compile: gcc -DHAVE_CONFIG_H -DNO_XMALLOC -I. -I.. -I. -I. -I.. -I.. -DIN_LIBUNISTRING -DDEPENDS_ON_LIBICONV=1 -g -O2 -c unicase/u16-casefold.c -fno-common -DPIC -o unicase/.libs/u16-casefold.o
libtool: compile: gcc -DHAVE_CONFIG_H -DNO_XMALLOC -I. -I.. -I. -I. -I.. -I.. -DIN_LIBUNISTRING -DDEPENDS_ON_LIBICONV=1 -g -O2 -c unicase/u16-casefold.c -o unicase/u16-casefold.o >/dev/null 2>&1
\
/bin/sh ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -DNO_XMALLOC -I. -I.. -I. -I. -I.. -I.. -DIN_LIBUNISTRING -DDEPENDS_ON_LIBICONV=1 -g -O2 -c -o unicase/u16-casemap.lo unicase/u16-casemap.c
libtool: compile: gcc -DHAVE_CONFIG_H -DNO_XMALLOC -I. -I.. -I. -I. -I.. -I.. -DIN_LIBUNISTRING -DDEPENDS_ON_LIBICONV=1 -g -O2 -c unicase/u16-casemap.c -fno-common -DPIC -o unicase/.libs/u16-casemap.o
In file included from unicase/u16-casemap.c:28:
./unictype.h:137: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'UC_CATEGORY_Cf'
make[3]: *** [unicase/u16-casemap.lo] Error 1
make[2]: *** [all] Error 2
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2

I'm running the command you suggested.

$ cd lib; gcc -E -dD -DHAVE_CONFIG_H -DNO_XMALLOC -I. -I.. -I. -I. -I.. -I.. -DIN_LIBUNISTRING -DDEPENDS_ON_LIBICONV=1 -g -O2 -c -o unicase/u16-casemap.lo unicase/u16-casemap.c

Inside the u16-casemap.lo file (attached), here is the interesting bit:

#define UNUSED_PARAMETER _GL_UNUSED
# 6 "./config.h" 2

#define UC_CATEGORY_C UC_CATEGORY_Cc UC_CATEGORY_Cf UC_CATEGORY_Cn UC_CATEGORY_Co UC_CATEGORY_Cs UC_CATEGORY_L UC_CATEGORY_Ll ...

I hope that helps.

(file #25535)

Shane Celis <shizzy0>
Sat 31 Mar 2012 09:56:15 PM UTC, comment #1:

As usual, for a bug report, please state the problem before you
jump to your proposed solution.

> ran into a small issue


What were the error messages from the compiler?

> The issue is there is a struct UC_CATEGORY_C and a macro by the same name.


Can you use "gcc -E -dD" of the source file to be compiled to find
out where this macro is defined?

Bruno Haible <haible>
Project AdministratorIn charge of this item.
Sat 31 Mar 2012 07:57:48 PM UTC, original submission:

Hi,

I was trying to get libunistring-0.9.3 to compile and ran into a small issue. My machine is running Mac OS X 10.6.8.

$ uname -a
Darwin mbp13.local 10.8.0 Darwin Kernel Version 10.8.0: Tue Jun 7 16:33:36 PDT 2011; root:xnu-1504.15.3~1/RELEASE_I386 i386

The issue is there is a struct UC_CATEGORY_C and a macro by the same name. They're used for categorically different things. I've attached a hack of a patch that I used to get around this issue. It seems to me that the real fix should be that the macro should have a distinct name, or perhaps there is a compiler flag that might resolve struct vs macro names differently on Mac OS X.

Shane Celis <shizzy0>

 

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

Attach File(s):
   
   
Comment:
   

Attached Files
file #25535:  u16-casemap.lo added by shizzy0 (196kB - application/octet-stream)
file #25534:  libunistring-0.9.3-macosx.patch added by shizzy0 (1kB - application/octet-stream)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by haible (Posted a comment)
  • -unavailable- added by shizzy0 (Submitted the item)
  • -unavailable- added by shizzy0
  •  

    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 5 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Sat 31 Mar 2012 10:09:22 PM UTCshizzy0Attached File-=>Added u16-casemap.lo, #25535
    Sat 31 Mar 2012 09:56:15 PM UTChaibleStatusNone=>Need Info
      Assigned toNone=>haible
    Sat 31 Mar 2012 07:57:48 PM UTCshizzy0Attached File-=>Added libunistring-0.9.3-macosx.patch, #25534
      Carbon-Copy-=>Added shizzy0

    Back to the top


    Powered by Savane 3.1-cleanup