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

 
 

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

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

Submitter:  Shane Celis <shizzy0>
Submitted:  Sat 31 Mar 2012 07:57:48 PM UTC
   
 
Category:  Build Severity:  3 - Normal
Item Group:  None Status:  Works For Me
Privacy:  Public Assigned to:  haible
Open/Closed:  Closed

Fri 09 Dec 2016 11:23:39 PM UTC, comment #4: 

The problem must have been during the execution of the target 'config.h' in lib/Makefile.am. Instead of producing something like

#define amemxfrm libunistring_amemxfrm
#define c_strcasecmp libunistring_c_strcasecmp
#define c_strncasecmp libunistring_c_strncasecmp
#define freea libunistring_freea
#define fseterr libunistring_fseterr
#define gl_locale_name libunistring_gl_locale_name
#define gl_locale_name_default libunistring_gl_locale_name_default
#define gl_locale_name_environ libunistring_gl_locale_name_environ
#define gl_locale_name_posix libunistring_gl_locale_name_posix
#define gl_locale_name_thread libunistring_gl_locale_name_thread
#define gl_unicase_special_lookup libunistring_gl_unicase_special_lookup
#define gl_uninorm_compose_lookup libunistring_gl_uninorm_compose_lookup
#define gl_uninorm_decomp_chars_table libunistring_gl_uninorm_decomp_chars_table
#define gl_uninorm_decomp_index_table libunistring_gl_uninorm_decomp_index_table
#define gl_uninorm_decompose_merge_sort_fromto libunistring_gl_uninorm_decompose_merge_sort_fromto
#define gl_uninorm_decompose_merge_sort_inplace libunistring_gl_uninorm_decompose_merge_sort_inplace
#define glthread_once_singlethreaded libunistring_glthread_once_singlethreaded
#define glthread_recursive_lock_init_multithreaded libunistring_glthread_recursive_lock_init_multithreaded
#define hard_locale libunistring_hard_locale
#define iconveh_close libunistring_iconveh_close
#define iconveh_open libunistring_iconveh_open
#define is_basic_table libunistring_is_basic_table
...
#define unilbrk_is_all_ascii libunistring_unilbrk_is_all_ascii
#define unilbrk_is_utf8_encoding libunistring_unilbrk_is_utf8_encoding
#define unilbrk_table libunistring_unilbrk_table
#define unilbrkprop libunistring_unilbrkprop
#define uniwbrk_table libunistring_uniwbrk_table

it produced a single line

#define XXX libunistring_XXX

where XXX = UC_CATEGORY_C UC_CATEGORY_Cc UC_CATEGORY_Cf ... unilbrk_table unilbrkprop uninorm_decomposing_form uninorm_filter_create uninorm_filter_flush uninorm_filter_free uninorm_filter_write uninorm_nfc uninorm_nfd uninorm_nfkc uninorm_nfkd uniwbrk_table

This points to a problem with 'sed', 'sort', 'uniq', 'grep', 'join', or the (generated) lib/exported.sh script.

In any case, I cannot reproduce it with libunistring-0.9.7 on OS X 10.11 with `gcc -v` = ... clang-700.1.81 ...
=> Closing as "Works for me".

Bruno Haible <haible>
Group administrator
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>
Group administrator
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>
Group administrator
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.)

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

 

Depends on the following items: None found

Items that depend on this one: None found

 

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

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

    Date Changed by Updated Field Previous Value => Replaced by
    2016-12-09 haible StatusNeed Info Works For Me
        Open/ClosedOpen Closed
    2016-11-24 haible CategoryNone Build
    2012-03-31 shizzy0 Attached File- Added u16-casemap.lo, #25535
    2012-03-31 haible StatusNone Need Info
        Assigned toNone haible
    2012-03-31 shizzy0 Attached File- Added libunistring-0.9.3-macosx.patch, #25534
        Carbon-Copy- Added shizzy0

    Back to the top

    Powered by Savane 3.13-f8d8.
    Corresponding source code