Opened 9 years ago

Last modified 5 years ago

#48016 closed defect

icu do not compile under OSX 10.7 (error: initialization of non-aggregate type with an initializer list) — at Version 4

Reported by: cgilles (HumanDynamo) Owned by: ryandesign@…
Priority: Normal Milestone:
Component: ports Version: 2.3.3
Keywords: Cc: rjvbertin@…
Port: icu

Description (last modified by ryandesign (Ryan Carsten Schmidt))

In order to compile digiKam bundle PKG for OSX, I tried successfuly to compile whole digiKam under OSX 10.10, 10.9, 10.8.

It fail under OSX 10.7 due to a C++11 code not supported by XCode/Clang :

OSX107:bundle gilles$ cat /opt/digikam/var/macports/logs//_opt_digikam_var_macports_sources_rsync.macports.org_release_tarballs_ports_devel_icu/icu/main.log
version:1
:debug:main Executing org.macports.main (icu)
:debug:main Skipping completed org.macports.archivefetch (icu)
:debug:main Skipping completed org.macports.fetch (icu)
:debug:main Skipping completed org.macports.checksum (icu)
:debug:main Skipping completed org.macports.extract (icu)
:debug:main Skipping completed org.macports.patch (icu)
:debug:main Skipping completed org.macports.configure (icu)
:debug:build build phase started at Thu Jun 11 00:17:45 CEST 2015
:notice:build --->  Building icu
:debug:build Executing org.macports.build (icu)
:debug:build Environment: 
CC_PRINT_OPTIONS='YES'
CC_PRINT_OPTIONS_FILE='/opt/digikam/var/macports/build/_opt_digikam_var_macports_sources_rsync.macports.org_release_tarballs_ports_devel_icu/icu/work/.CC_PRINT_OPTIONS'
CPATH='/opt/digikam/include'
LIBRARY_PATH='/opt/digikam/lib'
MACOSX_DEPLOYMENT_TARGET='10.7'
:debug:build Assembled command: 'cd "/opt/digikam/var/macports/build/_opt_digikam_var_macports_sources_rsync.macports.org_release_tarballs_ports_devel_icu/icu/work/icu/source" && /usr/bin/gnumake -j4 -w all VERBOSE=1'
:debug:build Executing command line:  cd "/opt/digikam/var/macports/build/_opt_digikam_var_macports_sources_rsync.macports.org_release_tarballs_ports_devel_icu/icu/work/icu/source" && /usr/bin/gnumake -j4 -w all VERBOSE=1 
:info:build gnumake: Entering directory `/opt/digikam/var/macports/build/_opt_digikam_var_macports_sources_rsync.macports.org_release_tarballs_ports_devel_icu/icu/work/icu/source'
:info:build /usr/bin/gnumake[0]: Making `all' in `stubdata'
:info:build gnumake[1]: Entering directory `/opt/digikam/var/macports/build/_opt_digikam_var_macports_sources_rsync.macports.org_release_tarballs_ports_devel_icu/icu/work/icu/source/stubdata'
:info:build gnumake[1]: Nothing to be done for `all'.
:info:build gnumake[1]: Leaving directory `/opt/digikam/var/macports/build/_opt_digikam_var_macports_sources_rsync.macports.org_release_tarballs_ports_devel_icu/icu/work/icu/source/stubdata'
:info:build /usr/bin/gnumake[0]: Making `all' in `common'
:info:build gnumake[1]: Entering directory `/opt/digikam/var/macports/build/_opt_digikam_var_macports_sources_rsync.macports.org_release_tarballs_ports_devel_icu/icu/work/icu/source/common'
:info:build /usr/bin/clang++ -DU_ATTRIBUTE_DEPRECATED= -DU_COMMON_IMPLEMENTATION -DU_HAVE_ATOMIC=1 -I. "-DDEFAULT_ICU_PLUGINS=\"/opt/digikam/lib/icu\" " -O2 -pipe -Os -arch x86_64 -stdlib=libc++ -W -Wall -pedantic -Wpointer-arith -Wwrite-strings -Wno-long-long --std=c++0x -fvisibility=hidden -fno-common -c -MMD -MT "putil.d putil.o putil.ao" -o putil.ao putil.cpp
:info:build /usr/bin/clang++ -DU_ATTRIBUTE_DEPRECATED= -DU_COMMON_IMPLEMENTATION -DU_HAVE_ATOMIC=1 -I. "-DDEFAULT_ICU_PLUGINS=\"/opt/digikam/lib/icu\" " -O2 -pipe -Os -arch x86_64 -stdlib=libc++ -W -Wall -pedantic -Wpointer-arith -Wwrite-strings -Wno-long-long --std=c++0x -fvisibility=hidden -fno-common -c -MMD -MT "uinit.d uinit.o uinit.ao" -o uinit.ao uinit.cpp
:info:build /usr/bin/clang++ -DU_ATTRIBUTE_DEPRECATED= -DU_COMMON_IMPLEMENTATION -DU_HAVE_ATOMIC=1 -I. "-DDEFAULT_ICU_PLUGINS=\"/opt/digikam/lib/icu\" " -O2 -pipe -Os -arch x86_64 -stdlib=libc++ -W -Wall -pedantic -Wpointer-arith -Wwrite-strings -Wno-long-long --std=c++0x -fvisibility=hidden -fno-common -c -MMD -MT "udata.d udata.o udata.ao" -o udata.ao udata.cpp
:info:build /usr/bin/clang++ -DU_ATTRIBUTE_DEPRECATED= -DU_COMMON_IMPLEMENTATION -DU_HAVE_ATOMIC=1 -I. "-DDEFAULT_ICU_PLUGINS=\"/opt/digikam/lib/icu\" " -O2 -pipe -Os -arch x86_64 -stdlib=libc++ -W -Wall -pedantic -Wpointer-arith -Wwrite-strings -Wno-long-long --std=c++0x -fvisibility=hidden -fno-common -c -MMD -MT "ucnv_bld.d ucnv_bld.o ucnv_bld.ao" -o ucnv_bld.ao ucnv_bld.cpp
:info:build uinit.cpp:27:33: error: initialization of non-aggregate type 'u_atomic_int32_t' (aka 'atomic<int32_t>') with an initializer list
:info:build static UInitOnce gICUInitOnce = U_INITONCE_INITIALIZER;
:info:build                                 ^~~~~~~~~~~~~~~~~~~~~~
:info:build ./umutex.h:199:33: note: expanded from macro 'U_INITONCE_INITIALIZER'
:info:build #define U_INITONCE_INITIALIZER {ATOMIC_INT32_T_INITIALIZER(0), U_ZERO_ERROR}
:info:build                                 ^
:info:build ./umutex.h:58:41: note: expanded from macro 'ATOMIC_INT32_T_INITIALIZER'
:info:build #define ATOMIC_INT32_T_INITIALIZER(val) ATOMIC_VAR_INIT(val)
:info:build                                         ^
:info:build /usr/bin/../lib/c++/v1/atomic:1497:30: note: expanded from macro 'ATOMIC_VAR_INIT'
:info:build #define ATOMIC_VAR_INIT(__v) {__v}
:info:build                              ^~~~~
:info:build uinit.cpp:66:20: warning: unused parameter 'status' [-Wunused-parameter]
:info:build u_init(UErrorCode *status) {
:info:build                    ^
:info:build 1 warning and 1 error generated.

Configuration :


OSX : 10.7.3
XCode : xcode_4.3.3_for_lion.dmg
CLI Tools : xcode452cltools10_76938212a.dmg

macports.conf includes these lines at end :

cxx_stdlib         libc++
buildfromsource    always
delete_la_files    yes

I tried to use another Clang version from Macports through port select without any difference :

port install clang_select
port install clang-3.6
port select --set clang mp-clang-3.6
port install icu

Thanks in advance to guide me.

Gilles Caulier

Change History (3)

comment:1 Changed 9 years ago by cgilles (HumanDynamo)

Cc: caulier.gilles@… added

Cc Me!

comment:3 Changed 9 years ago by RJVB (René Bertin)

It seems that port select only set the clang version available as /opt/local/bin/clang and clang++, but that doesn't make that the compiler used for building ports. I'm not even sure you can change the default for that globally.

While still under 10.6, adding configure.compiler=XXXX became an acquired motor programme for me ;)

comment:4 Changed 9 years ago by ryandesign (Ryan Carsten Schmidt)

Cc: rjvbertin@… added; ryandesign caulier.gilles@… removed
Description: modified (diff)
Owner: changed from macports-tickets@… to ryandesign@…

caulier.gilles, please remember to use WikiFormatting, that the Cc field requires complete email addresses, and that it is unnecessary to Cc yourself when you are the reporter.

What version of clang do you have? Run clang -v to find out.

You've shown that you're running Xcode 4.3.3, and the Xcode command line tools from Xcode 4.5.2... you should not mismatch these versions, and if possible you should use the latest version for each, which is 4.6.3. Upgrading these may fix the problem; if so, we can blacklist the older clang you were using before.

rjvbertin, yes, port select only affects the user's own actions on the command line; it does not affect what MacPorts does when it builds ports (or, if it does, then it is a bug).

You are correct, a user cannot change the default compiler that will be used for all of MacPorts.

Users should not get in the habit of overriding configure.compiler at the command line, however it is a useful tool to try out different compilers, which can then be added to the portfile as a compiler.blacklist.

Note: See TracTickets for help on using tickets.