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

 
 

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

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

Submitted by:  Shane Celis <shizzy0>
Submitted on:  Sat Mar 31 19:57:48 2012  
 
Category: BuildSeverity: 3 - Normal
Item Group: NoneStatus: Works For Me
Privacy: PublicAssigned to: Bruno Haible <haible>
Open/Closed: Closed

Fri Dec 9 23:23:39 2016, 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>
Project AdministratorIn charge of this item.
Sun Apr 1 09:58:40 2012, 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 Mar 31 22:09:22 2012, 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 Mar 31 21:56:15 2012, 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 Mar 31 19:57:48 2012, 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>

 

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

    Date Changed By Updated Field Previous Value => Replaced By
    Fri Dec 9 23:23:39 2016haibleStatusNeed Info=>Works For Me
      Open/ClosedOpen=>Closed
    Thu Nov 24 00:28:34 2016haibleCategoryNone=>Build
    Sat Mar 31 22:09:22 2012shizzy0Attached File-=>Added u16-casemap.lo, #25535
    Sat Mar 31 21:56:15 2012haibleStatusNone=>Need Info
      Assigned toNone=>haible
    Sat Mar 31 19:57:48 2012shizzy0Attached File-=>Added libunistring-0.9.3-macosx.patch, #25534
      Carbon-Copy-=>Added shizzy0

    Back to the top


    Powered by Savane 3.1-cleanup