Opened 7 years ago

Closed 6 years ago

#53577 closed defect (fixed)

db60 @6.0.30_2 build fails with atomic_init error, clang-3.8 or clang-3.9, MacOSX 10.6.8/libc++ but builds correctly with clang-3.7

Reported by: kencu (Ken) Owned by: afb@…
Priority: Normal Milestone:
Component: ports Version:
Keywords: snowleopard Cc: ballapete (Peter "Pete" Dyballa)
Port: db60

Description

something is different between clang-3.7 and later clang versions. Not sure what, exactly. Clang-3.7 appears to work correctly, though. I'm not sure if this is specific to Snow Leopard with libc++ or might happen on other systems as well.

:info:build In file included from ../lang/cxx/cxx_channel.cpp:13:
:info:build In file included from ./db_cxx.h:55:
:info:build In file included from /opt/local/libexec/llvm-3.9/bin/../include/c++/v1/iostream:38:
:info:build In file included from /opt/local/libexec/llvm-3.9/bin/../include/c++/v1/ios:216:
:info:build In file included from /opt/local/libexec/llvm-3.9/bin/../include/c++/v1/__locale:15:
:info:build In file included from /opt/local/libexec/llvm-3.9/bin/../include/c++/v1/string:442:
:info:build In file included from /opt/local/libexec/llvm-3.9/bin/../include/c++/v1/algorithm:634:
:info:build In file included from /opt/local/libexec/llvm-3.9/bin/../include/c++/v1/memory:618:
:info:build /opt/local/libexec/llvm-3.9/bin/../include/c++/v1/atomic:1148:13: error: expected unqualified-id
:info:build atomic_init(volatile atomic<_Tp>* __o, _Tp __d) _NOEXCEPT
:info:build             ^
:info:build /opt/local/libexec/llvm-3.9/bin/../include/c++/v1/atomic:1148:13: error: expected ')'
:info:build /opt/local/libexec/llvm-3.9/bin/../include/c++/v1/atomic:1148:1: note: to match this '('
:info:build atomic_init(volatile atomic<_Tp>* __o, _Tp __d) _NOEXCEPT
:info:build ^
:info:build ../src/dbinc/atomic.h:73:30: note: expanded from macro 'atomic_init'
:info:build #define atomic_init(p, val)     ((p)->value = (val))
:info:build                                  ^
:info:build In file included from ../lang/cxx/cxx_channel.cpp:13:
:info:build In file included from ./db_cxx.h:55:
:info:build In file included from /opt/local/libexec/llvm-3.9/bin/../include/c++/v1/iostream:38:
:info:build In file included from /opt/local/libexec/llvm-3.9/bin/../include/c++/v1/ios:216:
:info:build In file included from /opt/local/libexec/llvm-3.9/bin/../include/c++/v1/__locale:15:
:info:build In file included from /opt/local/libexec/llvm-3.9/bin/../include/c++/v1/string:442:
:info:build In file included from /opt/local/libexec/llvm-3.9/bin/../include/c++/v1/algorithm:634:
:info:build In file included from /opt/local/libexec/llvm-3.9/bin/../include/c++/v1/memory:618:
:info:build /opt/local/libexec/llvm-3.9/bin/../include/c++/v1/atomic:1148:1: error: expected ')'
:info:build atomic_init(volatile atomic<_Tp>* __o, _Tp __d) _NOEXCEPT
:info:build ^
:info:build ../src/dbinc/atomic.h:73:33: note: expanded from macro 'atomic_init'
:info:build #define atomic_init(p, val)     ((p)->value = (val))
:info:build                                     ^
:info:build /opt/local/libexec/llvm-3.9/bin/../include/c++/v1/atomic:1148:1: note: to match this '('
:info:build ../src/dbinc/atomic.h:73:29: note: expanded from macro 'atomic_init'
:info:build #define atomic_init(p, val)     ((p)->value = (val))
:info:build                                 ^
:info:build In file included from ../lang/cxx/cxx_channel.cpp:13:
:info:build In file included from ./db_cxx.h:55:
:info:build In file included from /opt/local/libexec/llvm-3.9/bin/../include/c++/v1/iostream:38:
:info:build In file included from /opt/local/libexec/llvm-3.9/bin/../include/c++/v1/ios:216:
:info:build In file included from /opt/local/libexec/llvm-3.9/bin/../include/c++/v1/__locale:15:
:info:build In file included from /opt/local/libexec/llvm-3.9/bin/../include/c++/v1/string:442:
:info:build In file included from /opt/local/libexec/llvm-3.9/bin/../include/c++/v1/algorithm:634:
:info:build In file included from /opt/local/libexec/llvm-3.9/bin/../include/c++/v1/memory:618:
:info:build /opt/local/libexec/llvm-3.9/bin/../include/c++/v1/atomic:1717:35: error: unknown type name 'atomic_flag'
:info:build atomic_flag_test_and_set(volatile atomic_flag* __o) _NOEXCEPT
:info:build                                   ^
:info:build /opt/local/libexec/llvm-3.9/bin/../include/c++/v1/atomic:1724:26: error: unknown type name 'atomic_flag'
:info:build atomic_flag_test_and_set(atomic_flag* __o) _NOEXCEPT
:info:build                          ^
:info:build /opt/local/libexec/llvm-3.9/bin/../include/c++/v1/atomic:1731:44: error: unknown type name 'atomic_flag'
:info:build atomic_flag_test_and_set_explicit(volatile atomic_flag* __o, memory_order __m) _NOEXCEPT
:info:build                                            ^
:info:build /opt/local/libexec/llvm-3.9/bin/../include/c++/v1/atomic:1738:35: error: unknown type name 'atomic_flag'
:info:build atomic_flag_test_and_set_explicit(atomic_flag* __o, memory_order __m) _NOEXCEPT
:info:build                                   ^
:info:build /opt/local/libexec/llvm-3.9/bin/../include/c++/v1/atomic:1745:28: error: unknown type name 'atomic_flag'
:info:build atomic_flag_clear(volatile atomic_flag* __o) _NOEXCEPT
:info:build                            ^
:info:build /opt/local/libexec/llvm-3.9/bin/../include/c++/v1/atomic:1752:19: error: unknown type name 'atomic_flag'
:info:build atomic_flag_clear(atomic_flag* __o) _NOEXCEPT
:info:build                   ^
:info:build /opt/local/libexec/llvm-3.9/bin/../include/c++/v1/atomic:1759:37: error: unknown type name 'atomic_flag'
:info:build atomic_flag_clear_explicit(volatile atomic_flag* __o, memory_order __m) _NOEXCEPT
:info:build                                     ^
:info:build /opt/local/libexec/llvm-3.9/bin/../include/c++/v1/atomic:1766:28: error: unknown type name 'atomic_flag'
:info:build atomic_flag_clear_explicit(atomic_flag* __o, memory_order __m) _NOEXCEPT
:info:build                            ^
:info:build In file included from ../lang/cxx/cxx_db.cpp:13:
:info:build In file included from ./db_cxx.h:55:
:info:build In file included from /opt/local/libexec/llvm-3.9/bin/../include/c++/v1/iostream:38:
:info:build In file included from /opt/local/libexec/llvm-3.9/bin/../include/c++/v1/ios:216:
:info:build In file included from /opt/local/libexec/llvm-3.9/bin/../include/c++/v1/__locale:15:
:info:build In file included from /opt/local/libexec/llvm-3.9/bin/../include/c++/v1/string:442:
:info:build In file included from /opt/local/libexec/llvm-3.9/bin/../include/c++/v1/algorithm:634:
:info:build In file included from /opt/local/libexec/llvm-3.9/bin/../include/c++/v1/memory:618:
:info:build /opt/local/libexec/llvm-3.9/bin/../include/c++/v1/atomic:1148:13: error: expected unqualified-id
:info:build atomic_init(volatile atomic<_Tp>* __o, _Tp __d) _NOEXCEPT
:info:build             ^
:info:build /opt/local/libexec/llvm-3.9/bin/../include/c++/v1/atomic:1148:13: error: expected ')'
:info:build /opt/local/libexec/llvm-3.9/bin/../include/c++/v1/atomic:1148:1: note: to match this '('
:info:build atomic_init(volatile atomic<_Tp>* __o, _Tp __d) _NOEXCEPT
:info:build ^
:info:build ../src/dbinc/atomic.h:73:30: note: expanded from macro 'atomic_init'
:info:build #define atomic_init(p, val)     ((p)->value = (val))
:info:build                                  ^
:info:build In file included from ../lang/cxx/cxx_db.cpp:13:
:info:build In file included from ./db_cxx.h:55:
:info:build In file included from /opt/local/libexec/llvm-3.9/bin/../include/c++/v1/iostream:38:
:info:build In file included from /opt/local/libexec/llvm-3.9/bin/../include/c++/v1/ios:216:
:info:build In file included from /opt/local/libexec/llvm-3.9/bin/../include/c++/v1/__locale:15:
:info:build In file included from /opt/local/libexec/llvm-3.9/bin/../include/c++/v1/string:442:
:info:build In file included from /opt/local/libexec/llvm-3.9/bin/../include/c++/v1/algorithm:634:
:info:build In file included from /opt/local/libexec/llvm-3.9/bin/../include/c++/v1/memory:618:
:info:build /opt/local/libexec/llvm-3.9/bin/../include/c++/v1/atomic:1148:1: error: expected ')'
:info:build atomic_init(volatile atomic<_Tp>* __o, _Tp __d) _NOEXCEPT
:info:build ^
:info:build ../src/dbinc/atomic.h:73:33: note: expanded from macro 'atomic_init'
:info:build #define atomic_init(p, val)     ((p)->value = (val))
:info:build                                     ^
:info:build /opt/local/libexec/llvm-3.9/bin/../include/c++/v1/atomic:1148:1: note: to match this '('
:info:build ../src/dbinc/atomic.h:73:29: note: expanded from macro 'atomic_init'
:info:build #define atomic_init(p, val)     ((p)->value = (val))
:info:build                                 ^
:info:build In file included from ../lang/cxx/cxx_db.cpp:13:
:info:build In file included from ./db_cxx.h:55:
:info:build In file included from /opt/local/libexec/llvm-3.9/bin/../include/c++/v1/iostream:38:
:info:build In file included from /opt/local/libexec/llvm-3.9/bin/../include/c++/v1/ios:216:
:info:build In file included from /opt/local/libexec/llvm-3.9/bin/../include/c++/v1/__locale:15:
:info:build In file included from /opt/local/libexec/llvm-3.9/bin/../include/c++/v1/string:442:
:info:build In file included from /opt/local/libexec/llvm-3.9/bin/../include/c++/v1/algorithm:634:
:info:build In file included from /opt/local/libexec/llvm-3.9/bin/../include/c++/v1/memory:618:
:info:build /opt/local/libexec/llvm-3.9/bin/../include/c++/v1/atomic:1717:35: error: unknown type name 'atomic_flag'
:info:build atomic_flag_test_and_set(volatile atomic_flag* __o) _NOEXCEPT
:info:build                                   ^
:info:build /opt/local/libexec/llvm-3.9/bin/../include/c++/v1/atomic:1724:26: error: unknown type name 'atomic_flag'
:info:build atomic_flag_test_and_set(atomic_flag* __o) _NOEXCEPT
:info:build                          ^
:info:build /opt/local/libexec/llvm-3.9/bin/../include/c++/v1/atomic:1731:44: error: unknown type name 'atomic_flag'
:info:build atomic_flag_test_and_set_explicit(volatile atomic_flag* __o, memory_order __m) _NOEXCEPT
:info:build                                            ^
:info:build /opt/local/libexec/llvm-3.9/bin/../include/c++/v1/atomic:1738:35: error: unknown type name 'atomic_flag'
:info:build atomic_flag_test_and_set_explicit(atomic_flag* __o, memory_order __m) _NOEXCEPT
:info:build                                   ^
:info:build /opt/local/libexec/llvm-3.9/bin/../include/c++/v1/atomic:1745:28: error: unknown type name 'atomic_flag'
:info:build atomic_flag_clear(volatile atomic_flag* __o) _NOEXCEPT
:info:build                            ^
:info:build /opt/local/libexec/llvm-3.9/bin/../include/c++/v1/atomic:1752:19: error: unknown type name 'atomic_flag'
:info:build atomic_flag_clear(atomic_flag* __o) _NOEXCEPT
:info:build                   ^
:info:build /opt/local/libexec/llvm-3.9/bin/../include/c++/v1/atomic:1759:37: error: unknown type name 'atomic_flag'
:info:build atomic_flag_clear_explicit(volatile atomic_flag* __o, memory_order __m) _NOEXCEPT
:info:build                                     ^
:info:build /opt/local/libexec/llvm-3.9/bin/../include/c++/v1/atomic:1766:28: error: unknown type name 'atomic_flag'
:info:build atomic_flag_clear_explicit(atomic_flag* __o, memory_order __m) _NOEXCEPT
:info:build                            ^
:info:build 11 errors generated.
:info:build make: *** [cxx_channel.lo] Error 1
:info:build make: *** Waiting for unfinished jobs....
:info:build 11 errors generated.
:info:build make: *** [cxx_db.lo] Error 1
:info:build make: Leaving directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_databases_db60/db60/work/db-6.0.30/build_unix'
:info:build Command failed:  cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_databases_db60/db60/work/db-6.0.30/build_unix" && /usr/bin/make -j2 -w all 
:info:build Exit code: 2

Attachments (2)

main.log (246.1 KB) - added by kencu (Ken) 7 years ago.
main.2.log (281.6 KB) - added by ballapete (Peter "Pete" Dyballa) 7 years ago.
main.log from clang-3.9 dependency

Download all attachments as: .zip

Change History (16)

Changed 7 years ago by kencu (Ken)

Attachment: main.log added

comment:1 Changed 7 years ago by mf2k (Frank Schima)

Cc: afb@… removed
Keywords: snowleopard added; SnowLeopard removed
Owner: set to afb@…
Status: newassigned

comment:2 Changed 7 years ago by ballapete (Peter "Pete" Dyballa)

The same error when updating Clang 3.9.

The question is: How is db60 improving Clang 3.9? Before it seemed to work fine with db48…

Changed 7 years ago by ballapete (Peter "Pete" Dyballa)

Attachment: main.2.log added

main.log from clang-3.9 dependency

comment:3 Changed 7 years ago by ballapete (Peter "Pete" Dyballa)

Cc: ballapete added

comment:4 Changed 7 years ago by ballapete (Peter "Pete" Dyballa)

How can I determine the port that is requesting db60 that I can throw it away?

comment:5 Changed 7 years ago by kencu (Ken)

You can build it with configure.compiler=macports-clang-3.7, though. At least I did.

comment:6 in reply to:  5 Changed 7 years ago by ballapete (Peter "Pete" Dyballa)

Replying to kencu:

You can build it with configure.compiler=macports-clang-3.7, though. At least I did.

I'd prefer not to.

What is db60 good for? What makes it distinct from db48? Does it have some unique features that are also useful?

comment:7 Changed 7 years ago by kencu (Ken)

The issue seems to be a name collision between db60 and clang's libc++ headers. Why it only affects some clang/libc++ systems is a puzzle, though.

Here is a thread about the issue <https://community.oracle.com/thread/3952592>.

I notice our db60 version is a bit dated; the current one is db-6.2.32.tar.gz.

Maybe they've fixed the name issue in the newer release. You could try updating it and see if the new version works.

Last edited 7 years ago by kencu (Ken) (previous) (diff)

comment:8 Changed 7 years ago by kencu (Ken)

I updated the port locally to 6.2.32 and that didn't fix the name collision. Also, forcing the standard to -std=c++98 didn't avoid the name collision either.

I'll make a PR for the version update, FWIW. The name collision remains an issue when -stdlib=libc++ though. I wonder how the newer systems are building this port? They should all be having this same issue...

comment:9 Changed 7 years ago by kencu (Ken)

The atomic types were added to clang in version 3.8 <http://releases.llvm.org/3.8.0/tools/clang/docs/ReleaseNotes.html#opencl-c-language-changes-in-clang> which would explain why clang-3.7 builds this but clang-3.8+ do not.

I tried --disable-atomicsupport which certainly sounded promising, but that didn't fix the build with clang-3.8+ / libc++ either.

If all the recent Apple clang's build this port, then they must not have the atomic name collision that the OSS clangs >= 3.8 have.

For now, if you need to build this port with a macports-clang compiler and you are using -stdlib=libc++, it looks like it will need to be macports-clang-3.7. Until Oracle gets around to changing their naming scheme, or otherwise changes the name scope / visibility somehow. Unless someone else has a clever idea.

comment:10 in reply to:  5 Changed 7 years ago by ballapete (Peter "Pete" Dyballa)

Replying to kencu:

You can build it with configure.compiler=macports-clang-3.7, though. At least I did.

If this is a hint to successfully build db60: Thank you, I don't want and I certainly don't need db60 (because it reminds of my age).

comment:11 Changed 7 years ago by ballapete (Peter "Pete" Dyballa)

Today clang-3.9, clang-4.0, llvm-4.0 were upgraded. It seems that the db60 issue was successfully solved.

comment:12 Changed 7 years ago by kencu (Ken)

Just so there is no confusion out there, db60 (and db62, when and if that port gets made) most certainly will not build using clang-3.8+ against libc++. It builds against libstdc++, or against libc++ with clang-3.7.

comment:13 Changed 7 years ago by kencu (Ken)

See also 54664 which is for the same issue, but with db48.

comment:14 Changed 6 years ago by kencu (Ken)

Resolution: fixed
Status: assignedclosed
Note: See TracTickets for help on using tickets.