Opened 10 years ago

Closed 9 years ago

#46973 closed defect (worksforme)

clang-3.4 @3.4.2_6 build fails, ML on OSX

Reported by: punch@… Owned by: jeremyhu (Jeremy Huddleston Sequoia)
Priority: Normal Milestone:
Component: ports Version: 2.3.3
Keywords: Cc: larryv (Lawrence Velázquez), petrrr, oliver.bock@…
Port: clang-3.4

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

I tried doing an upgrade from 3.4.2_5 to 3.4.2_6 and the build fails. This is under Mountain Lion on OSX. I ran down the make error, relevant info below. Two traces so you need to scroll down.

main.log

debug:build Executing org.macports.build (clang-3.4)
...skipping...
release_tarballs_ports_lang_llvm-3.4/clang-3.4/work/llvm-3.4.2.src/projects/compiler-rt/make/platform/clang_darwin_test_input.c -isysroot /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_lang_llvm-3.4/clang-3.4/work/llvm-3.4.2.src/projects/compiler-rt/SDKs/darwin -o /dev/null > /dev/null 2> /de
v/null
:info:build warning: clang_darwin.mk: dropping arch 'x86_64' from lib 'ubsan_osx'
:info:build make[4]: Entering directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_lang_llvm-3.4/clang-3.4/work/llvm-3.4.2.src/projects/compiler-rt'
:info:build make/platform/clang_linux.mk:16: *** "unable to infer compiler target triple for /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_lang_llvm-3.4/clang-3.4/work/llvm-3.4.2.src/Release+Debug+Asserts/bin/clang".  Stop.
:info:build make[4]: Leaving directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_lang_llvm-3.4/clang-3.4/work/llvm-3.4.2.src/projects/compiler-rt'
:info:build make[3]: *** [BuildRuntimeLibraries] Error 2
:info:build rm /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_lang_llvm-3.4/clang-3.4/work/llvm-3.4.2.src/Release+Debug+Asserts/lib/clang/3.4.2/lib/darwin_embedded/.dir /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_lang_llvm-3.4/clang-3.4/work/llvm-3.4.2.src/Release+Debug+Asserts/lib/clang/3.4.2/lib/darwin/.dir
:info:build make[3]: Leaving directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_lang_llvm-3.4/clang-3.4/work/llvm-3.4.2.src/tools/clang/runtime/compiler-rt'
:info:build make[2]: *** [compiler-rt/.makeall] Error 2
:info:build make[2]: Leaving directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_lang_llvm-3.4/clang-3.4/work/llvm-3.4.2.src/tools/clang/runtime'
:info:build make[1]: *** [all] Error 1
:info:build make[1]: Leaving directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_lang_llvm-3.4/clang-3.4/work/llvm-3.4.2.src/tools/clang'
:info:build make: *** [all] Error 1
:info:build make: Leaving directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_lang_llvm-3.4/clang-3.4/work/llvm-3.4.2.src'
:info:build Command failed:  cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_lang_llvm-3.4/clang-3.4/work/llvm-3.4.2.src" && /usr/bin/make -j8 -w clang-only
:info:build Exit code: 2
:error:build org.macports.build for port clang-3.4 returned: command execution failed
:debug:build Error code: CHILDSTATUS 74521 2
:debug:build Backtrace: command execution failed
    while executing
"system -nice 0 $fullcmdstring"
    ("eval" body line 1)
    invoked from within
"eval system $notty $nice \$fullcmdstring"
    invoked from within
"command_exec build"
    (procedure "portbuild::build_main" line 8)
    invoked from within
"portbuild::build_main org.macports.build"
    ("eval" body line 1)
    invoked from within
"eval $procedure $targetname"
:info:build Warning: targets not executed for clang-3.4: org.macports.install org.macports.build org.macports.destroot
:notice:build Please see the log file for port clang-3.4 for details:
    /opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_lang_llvm-3.4/clang-3.4/main.log

I cd to llvm-3.4.2.src and run /usr/bin/make -j8 -w clang-only, relevant info below

make[3]: Entering directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_lang_llvm-3.4/clang-3.4/work/llvm-3.4.2.src/lib/Transforms/Hello'
make[4]: Entering directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_lang_llvm-3.4/clang-3.4/work/llvm-3.4.2.src/lib/Target/Sparc/MCTargetDesc'
make[4]: Nothing to be done for `all'.
make[4]: Leaving directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_lang_llvm-3.4/clang-3.4/work/llvm-3.4.2.src/lib/Target/Sparc/MCTargetDesc'
make[3]: Leaving directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_lang_llvm-3.4/clang-3.4/work/llvm-3.4.2.src/lib/Target/Sparc'
/bin/sh: /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_lang_llvm-3.4/clang-3.4/work/llvm-3.4.2.src/lib/Transforms/Hello/Release+Debug+Asserts/Hello.exports.sed: Permission denied
make[3]: *** [/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_lang_llvm-3.4/clang-3.4/work/llvm-3.4.2.src/lib/Transforms/Hello/Release+Debug+Asserts/Hello.exports.sed] Error 1
make[3]: Leaving directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_lang_llvm-3.4/clang-3.4/work/llvm-3.4.2.src/lib/Transforms/Hello'
make[4]: Entering directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_lang_llvm-3.4/clang-3.4/work/llvm-3.4.2.src/lib/Target/AArch64/AsmParser'
make[4]: Nothing to be done for `all'.

I cd to /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_lang_llvm-3.4/clang-3.4/work/llvm-3.4.2.src/lib/Transforms/Hello to see what's up.

In Hello is: CMakeLists.txt, Hello.cpp Hello.exports Makefile and the directory Release+Debug+Asserts Hello.exports is empty. In that directory is: Hello.d and Hello.o no .sed file (so not really a permissions problem?).

Attachments (2)

main.log (196.3 KB) - added by punch@… 10 years ago.
copy of the main.log
main.2.log (4.9 MB) - added by punch@… 10 years ago.
main.log after clean and with build.jobs=1

Change History (24)

comment:1 Changed 10 years ago by ryandesign (Ryan Carsten Schmidt)

Description: modified (diff)
Owner: changed from macports-tickets@… to jeremyhu@…
Port: clang-3.4 added
Summary: clang 3.4.2_6 build fails, ML on OSXclang-3.4 @3.4.2_6 build fails, ML on OSX

Please attach the entire main.log file.

comment:2 in reply to:  description Changed 10 years ago by larryv (Lawrence Velázquez)

I can’t reproduce this with clang @3.4.2_6+analyzer+arm_runtime.

This

:info:build warning: clang_darwin.mk: dropping arch 'x86_64' from lib 'ubsan_osx'

and this

:info:build make/platform/clang_linux.mk:16: *** "unable to infer compiler target triple for /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_lang_llvm-3.4/clang-3.4/work/llvm-3.4.2.src/Release+Debug+Asserts/bin/clang".  Stop.

make me suspect your toolchain, but I’ll wait for your log.

I cd to llvm-3.4.2.src and run /usr/bin/make -j8 -w clang-only, relevant info below

This could never have worked because the build directory was probably owned by the macports user. You wouldn’t have had permissions to correctly complete the build.

comment:3 Changed 10 years ago by larryv (Lawrence Velázquez)

Cc: larryv@… added

Cc Me!

Changed 10 years ago by punch@…

Attachment: main.log added

copy of the main.log

comment:4 in reply to:  3 ; Changed 10 years ago by punch@…

Replying to larryv@…: I added the full main.log

I'm using gcc4.7.4_3 from macports for the build. Could be the tool chain but I don't know why as I have clang3.4 and clang3.6 from macports that built less than a month ago without issue and I haven't changed anything since then.

comment:5 in reply to:  4 ; Changed 10 years ago by larryv (Lawrence Velázquez)

Replying to punch@…:

Replying to larryv@…: I added the full main.log

You did not. This log is incomplete.

:debug:main Skipping completed org.macports.archivefetch (clang-3.4)
:debug:main Privilege de-escalation not attempted as not running as root.
:debug:main Skipping completed org.macports.fetch (clang-3.4)
:debug:main Privilege de-escalation not attempted as not running as root.
:debug:main Skipping completed org.macports.checksum (clang-3.4)
:debug:main Privilege de-escalation not attempted as not running as root.
:debug:main Skipping completed org.macports.extract (clang-3.4)
:debug:main Privilege de-escalation not attempted as not running as root.
:debug:main Skipping completed org.macports.patch (clang-3.4)
:debug:main Privilege de-escalation not attempted as not running as root.
:debug:main Skipping completed org.macports.configure (clang-3.4)
:debug:main Privilege de-escalation not attempted as not running as root.
:debug:build build phase started at Thu Feb 26 14:30:57 EST 2015

Please run sudo port clean clang-3.4 and try upgrading again, then attach the log if that fails.

I'm using gcc4.7.4_3 from macports for the build. Could be the tool chain but I don't know why as I have clang3.4 and clang3.6 from macports that built less than a month ago without issue and I haven't changed anything since then.

Why are you building this with GCC? We don’t really support that.

comment:6 in reply to:  5 Changed 10 years ago by larryv (Lawrence Velázquez)

Replying to larryv@…:

Please run sudo port clean clang-3.4 and try upgrading again

Actually, please run

$ sudo port clean clang-3.4
$ sudo port upgrade clang-3.4 build.jobs=1

It’ll take longer, but the log will be easier to examine.

Changed 10 years ago by punch@…

Attachment: main.2.log added

main.log after clean and with build.jobs=1

comment:7 Changed 10 years ago by punch@…

I did do a clean then a rebuild using build.jobs=1. New, now in fact full, version of main.log attached. Appreciate your time for looking into this

--bill

comment:8 Changed 10 years ago by jeremyhu (Jeremy Huddleston Sequoia)

:info:build /bin/sh: line 1: 15920 Trace/BPT trap: 5       /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_lang_llvm-3.4/clang-3.4/work/llvm-3.4.2.src/Release+Debug+Asserts/bin/clang -arch $arch -c -integrated-as /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_lang_llvm-3.4/clang-3.4/work/llvm-3.4.2.src/projects/compiler-rt/make/platform/clang_darwin_test_input.c -isysroot /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_lang_llvm-3.4/clang-3.4/work/llvm-3.4.2.src/projects/compiler-rt/SDKs/darwin -o /dev/null > /dev/null 2> /dev/null

What happens when you try to do:

/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_lang_llvm-3.4/clang-3.4/work/llvm-3.4.2.src/Release+Debug+Asserts/bin/clang -arch x86_64 -c -integrated-as /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_lang_llvm-3.4/clang-3.4/work/llvm-3.4.2.src/projects/compiler-rt/make/platform/clang_darwin_test_input.c -isysroot /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_lang_llvm-3.4/clang-3.4/work/llvm-3.4.2.src/projects/compiler-rt/SDKs/darwin -o /dev/null

and similar?

comment:9 Changed 10 years ago by jeremyhu (Jeremy Huddleston Sequoia)

Do you have any crash logs you can attach?

comment:10 Changed 10 years ago by petrrr

Cc: petr@… added

Cc Me!

comment:11 in reply to:  8 Changed 10 years ago by punch@…

Replying to jeremyhu@…:

:info:build /bin/sh: line 1: 15920 Trace/BPT trap: 5       /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_lang_llvm-3.4/clang-3.4/work/llvm-3.4.2.src/Release+Debug+Asserts/bin/clang -arch $arch -c -integrated-as /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_lang_llvm-3.4/clang-3.4/work/llvm-3.4.2.src/projects/compiler-rt/make/platform/clang_darwin_test_input.c -isysroot /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_lang_llvm-3.4/clang-3.4/work/llvm-3.4.2.src/projects/compiler-rt/SDKs/darwin -o /dev/null > /dev/null 2> /dev/null

What happens when you try to do:

/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_lang_llvm-3.4/clang-3.4/work/llvm-3.4.2.src/Release+Debug+Asserts/bin/clang -arch x86_64 -c -integrated-as /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_lang_llvm-3.4/clang-3.4/work/llvm-3.4.2.src/projects/compiler-rt/make/platform/clang_darwin_test_input.c -isysroot /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_lang_llvm-3.4/clang-3.4/work/llvm-3.4.2.src/projects/compiler-rt/SDKs/darwin -o /dev/null

and similar?

The first command fails with a symbol error:

sudo /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_lang_llvm-3.4/clang-3.4/work/llvm-3.4.2.src/Release+Debug+Asserts/bin/clang -arch x86_64 -c -integrated-as

Password: dyld: Symbol not found: ZN4llvm9DebugFlagE

Referenced from: /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_lang_llvm-3.4/clang-3.4/work/llvm-3.4.2.src/Release+Debug+Asserts/bin/clang Expected in: /opt/local/libexec/llvm-3.4/lib/libLLVM-3.4.dylib

comment:12 Changed 10 years ago by oliver.bock@…

I get a similar error (missing symbol):

/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_lang_llvm-3.4/clang-3.4/work/llvm-3.4.2.src/Release+Debug+Asserts/bin/clang
dyld: Symbol not found: _AnnotateHappensAfter
  Referenced from: /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_lang_llvm-3.4/clang-3.4/work/llvm-3.4.2.src/Release+Debug+Asserts/bin/clang
  Expected in: /opt/local/libexec/llvm-3.4/lib/libLLVM-3.4.dylib
 in /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_lang_llvm-3.4/clang-3.4/work/llvm-3.4.2.src/Release+Debug+Asserts/bin/clang
Trace/BPT trap
Last edited 10 years ago by oliver.bock@… (previous) (diff)

comment:13 Changed 10 years ago by oliver.bock@…

Cc: oliver.bock@… added

Cc Me!

comment:14 Changed 10 years ago by jeremyhu (Jeremy Huddleston Sequoia)

What are the variants for llvm-3.4 that is installed and the clang-3.4 that is installing?

comment:15 Changed 10 years ago by oliver.bock@…

None for LLVM:

$ port installed llvm-3.4
The following ports are currently installed:
  llvm-3.4 @3.4_3
  llvm-3.4 @3.4.2_6 (active)

Clang 3.4 isn't installed at all (which should mean default/no variants); Clang 3.5 is the one I'm trying to update and it's triggering the Clang 3.4 build for some reason. It has the following variants enabled:

$ port installed clang-3.5
The following ports are currently installed:
  clang-3.5 @3.5-r210448_0+analyzer+assertions (active)
$ port installed llvm-3.5
The following ports are currently installed:
  llvm-3.5 @3.5-r210448_0+assertions (active)

Why is the clang-3.4 installation triggered anyway when I try to update the installed clang-3.5 port?

Last edited 10 years ago by oliver.bock@… (previous) (diff)

comment:16 Changed 10 years ago by jeremyhu (Jeremy Huddleston Sequoia)

Well what variants are being used by the clang-3.4 install that is trying to take place?

As for why clang-3.4 is being used, it's probably because your system compiler is too old:

# llvm-3.5 and later requires a C++11 runtime
# XCode 4.3's clang (318.x) fails per https://trac.macports.org/ticket/44161
# XCode 4.5's clang (421.11.66) fails due to http://llvm.org/bugs/show_bug.cgi?id=20184
# Xcode 4.6.x's clang (425.0.28) works, assuming 425.0.24 from 4.6.0 works too
compiler.blacklist *gcc* macports-clang-2.9 macports-clang-3.0 macports-clang-3.1 {clang < 425.0.24}

comment:17 Changed 10 years ago by oliver.bock@…

Well what variants are being used by the clang-3.4 install that is trying to take place?

Well, I suppose the default variants since clang-3.4 is installed as a dependency of the clang-3.5 upgrade (see above). That would mean "+analyzer". Looking at the distfile fetch, however, it seems that following variants (matching the clang-3.5 variants, see above) are used:

Attempting to fetch clang-3.4-3.4.2_6+analyzer+assertions.darwin_10.x86_64.tbz2

Does that help?

comment:18 Changed 10 years ago by oliver.bock@…

As for why clang-3.4 is being used, it's probably because your system compiler is too old:

Hm, but clang-3.5 is already installed on that system (see above) and I'm just trying to update it as usual. If 3.5 would be fundamentally unsupported by that particular system (OS X 10.6.8, i686-apple-darwin10-gcc-4.2.1, i686-apple-darwin10-llvm-gcc-4.2 (GCC) 4.2.1), I shouldn't have been able to install it in the first place.

Last edited 10 years ago by oliver.bock@… (previous) (diff)

comment:19 Changed 10 years ago by punch@…

So I completely uninstalled clang-3.4 and its dependencies. Then I tried a reinstall (without cleaning). I got the following:

sudo port install clang-3.4

Error: Requested variants "+analyzer+arm_runtime" do not match original selection "+analyzer+arm_runtime+assertions". Please use the same variants again, perform 'port clean clang-3.4' or specify the force >option (-f). To report a bug, follow the instructions in the guide:

http://guide.macports.org/#project.tickets

Error: Processing of port clang-3.4 failed

I did a clean then tried the reinstall and it worked without a problem. I'm not clear why I'm getting the arm-runtime variant, but at least it installed without an error this time.

comment:20 Changed 10 years ago by jeremyhu (Jeremy Huddleston Sequoia)

So it looks like you're trying to install a +asserions clang-3.4 with a -assertions llvm-3.4. That is not supported. We should use the active_variants port group to enforce that.

comment:21 Changed 10 years ago by oliver.bock@…

So it looks like you're trying to install a +asserions clang-3.4 with a -assertions llvm-3.4. That is not supported

That's right. As soon as I installed llwm-3.4 +assertions the upgrade went fine, including clang-3.4 and clang-3.5. I still don't see how that inconsistency could manifest itself in the first place though... Oh well...

Thanks!

comment:22 Changed 9 years ago by jeremyhu (Jeremy Huddleston Sequoia)

Resolution: worksforme
Status: newclosed
Note: See TracTickets for help on using tickets.