Opened 9 years ago

Closed 4 years ago

Last modified 4 years ago

#46040 closed defect (fixed)

llvm-*, clang-*: all binaries are overlinked to libedit, libffi, ncurses, and zlib

Reported by: pj@… Owned by: larryv (Lawrence Velázquez)
Priority: Normal Milestone:
Component: ports Version: 2.3.3
Keywords: Cc: dershow, jeremyhu (Jeremy Huddleston Sequoia), yarrgk@…, nmsnoopy@…, kencu (Ken)
Port: clang-3.3 llvm-3.3 clang-3.4 llvm-3.4 clang-3.5 llvm-3.5 clang-3.6 llvm-3.6

Description (last modified by larryv (Lawrence Velázquez))

Hey, I am trying to update and Openmodelica on my Mac 10.10.
Having serious issues since I am brand new to mac and ports and so on.
Assistance would be appreciated in baby simple steps.

I have followed the steps listed on
https://www.openmodelica.org/download/download-mac
but once I need to run:

--> port install gcc44

the error below shows up. As root and using sudo


Errors


Pieters-MacBook-Pro:logs pjc$ sudo port install gcc44
--->  Computing dependencies for gcc44
--->  Dependencies to be installed: libgcc libgcc45
--->  Building libgcc
Error: org.macports.build for port libgcc returned: command execution failed
Error: Failed to install libgcc
Please see the log file for port libgcc for details:
    /opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_lang_gcc49/libgcc/main.log
Error: The following dependencies were not installed: libgcc libgcc45
To report a bug, follow the instructions in the guide:
    http://guide.macports.org/#project.tickets
Error: Processing of port gcc44 failed

Attachments (4)

main.log (12.0 KB) - added by pj@… 9 years ago.
main.2.log (5.1 MB) - added by larryv (Lawrence Velázquez) 9 years ago.
OP's full log, sent via email
main.log.gz (6.2 KB) - added by facardillo@… 9 years ago.
Log of libedit install
config.log (100.2 KB) - added by dershow 9 years ago.

Change History (33)

Changed 9 years ago by pj@…

Attachment: main.log added

comment:1 Changed 9 years ago by larryv (Lawrence Velázquez)

Cc: mww@… added
Description: modified (diff)
Owner: changed from macports-tickets@… to larryv@…
Port: libgcc added
Status: newassigned
Summary: [Openmodelica][2.3.3][Installation and update]libgcc build failure

The log is not complete. Please clean libgcc and try installing again. Attach the new main.log if it fails again.

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

That is, please run the following commands:

% sudo port clean libgcc
% sudo port install libgcc

If you see another build failure, attach the new main.log.

comment:3 Changed 9 years ago by dershow

I am also seeing a problem with libgcc. In my case it is an upgrade from 4.9.2_0 to 4.9.2_1 that fails. I see a couple of recent tickets that might relate: #46020 #45954 r128719

My log file, for the attempted upgrade, ends like this:

:info:build checking for iconv... yes
:info:build checking how to link with libiconv... -liconv
:info:build checking for iconv declaration... install-shextern size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);
:info:build configure: updating cache ./config.cache
:info:build configure: creating ./config.status
:info:build config.status: creating Makefile
:info:build config.status: creating config.h
:info:build config.status: executing depdir commands
:info:build mkdir .deps
:info:build make[2]: Leaving directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_lang_gcc49/libgcc/work/build'
:info:build make[1]: *** [stage1-bubble] Error 2
:info:build make[1]: Leaving directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_lang_gcc49/libgcc/work/build'
:info:build make: *** [bootstrap] Error 2
:info:build make: Leaving directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_lang_gcc49/libgcc/work/build'
:info:build Command failed:  cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_lang_gcc49/libgcc/work/build" && /usr/bin/make -j8 -w bootstrap 
:info:build Exit code: 2
:error:build org.macports.build for port libgcc returned: command execution failed
:debug:build Error code: CHILDSTATUS 32339 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 libgcc: org.macports.install org.macports.build org.macports.destroot
:notice:build Please see the log file for port libgcc for details:
    /opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_lang_gcc49/libgcc/main.log

I can attach a full log if that would be helpful. I am on 10.9.5.

Last edited 9 years ago by ryandesign (Ryan Carsten Schmidt) (previous) (diff)

comment:4 in reply to:  3 Changed 9 years ago by larryv (Lawrence Velázquez)

For triage purposes, please open a new ticket and attach a complete log.

comment:5 Changed 9 years ago by dershow

As suggested, I created a new ticket: #46063

Last edited 9 years ago by ryandesign (Ryan Carsten Schmidt) (previous) (diff)

comment:6 Changed 9 years ago by dershow

Cc: dersh@… added

Cc Me!

Changed 9 years ago by larryv (Lawrence Velázquez)

Attachment: main.2.log added

OP's full log, sent via email

comment:7 Changed 9 years ago by larryv (Lawrence Velázquez)

Cc: jeremyhu@… added; mww@… removed
Port: llvm-3.5 llvm-3.6 added; libgcc removed
Summary: libgcc build failurellvm-3.5, llvm-3.6: libLTO uses libedit, ncurses, zlib without declaring dependencies

The OP sent me a complete log via email.

:info:build collect2: error: ld terminated with signal 5 [Trace/BPT trap: 5]
:info:build dyld: Library not loaded: /opt/local/lib/libedit.0.dylib
:info:build   Referenced from: /opt/local/libexec/llvm-3.5/lib/libLTO.dylib
:info:build   Reason: image not found

It’s not clear to me why libLTO.dylib links to libedit, and the llvm-3.5 port does not declare a dependency on the libedit port. On my system, libLTO uses libraries from zlib, libffi, libedit, and ncurses — only one of which llvm-3.6 declares a dependency on:

% otool -L /opt/local/libexec/llvm-3.6/lib/libLTO.dylib
/opt/local/libexec/llvm-3.6/lib/libLTO.dylib:
	/opt/local/libexec/llvm-3.6/lib/libLTO.dylib (compatibility version 0.0.0, current version 0.0.0)
	/opt/local/libexec/llvm-3.6/lib/libLLVM-3.6svn.dylib (compatibility version 0.0.0, current version 0.0.0)
	/opt/local/lib/libz.1.dylib (compatibility version 1.0.0, current version 1.2.8)
	/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1213.0.0)
	/opt/local/lib/libffi.6.dylib (compatibility version 7.0.0, current version 7.4.0)
	/opt/local/lib/libedit.0.dylib (compatibility version 1.0.0, current version 1.51.0)
	/opt/local/lib/libncurses.5.dylib (compatibility version 5.0.0, current version 5.0.0)
	/usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 120.0.0)
% port deps llvm-3.6
Full Name: llvm-3.6 @3.6-r222672_0+assertions
Fetch Dependencies:   subversion
Library Dependencies: libffi, libcxx
Runtime Dependencies: perl5, llvm_select
%

You must have removed libedit at some point, and MacPorts didn’t stop you because llvm-3.5 doesn’t claim to require it. You can work around this by reinstalling libedit.

Jeremy, does libLTO really use these libraries?

Version 0, edited 9 years ago by larryv (Lawrence Velázquez) (next)

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

Looks like a bug in the build system adding unnecessary links. I only see symbols being pulled in from from libLLVM-3, libSystem, and libc++

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

Reported upstream, but I'll look into it when I get cycles:

http://llvm.org/bugs/show_bug.cgi?id=21693

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

Owner: changed from larryv@… to jeremyhu@…
Status: assignednew

comment:11 in reply to:  9 Changed 9 years ago by larryv (Lawrence Velázquez)

Cc: larryv@… added; jeremyhu@… removed
Port: llvm-3.3 llvm-3.4 added
Summary: llvm-3.5, llvm-3.6: libLTO uses libedit, ncurses, zlib without declaring dependenciesllvm-*: libLTO uses libedit, ncurses, zlib without declaring dependencies

Great, thanks. Roping in llvm-3.3 and llvm-3.4 based on your observations in the upstream report.

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

Cc: yarrgk@… added

Has duplicate #46121.

This is also causing builds on the buildbot builders to fail, e.g. pdftk.

comment:13 Changed 9 years ago by larryv (Lawrence Velázquez)

While libLTO’s linking is unwanted and should still be fixed, libLLVM-3 does seem to use these libraries, so maybe the port should declare dependencies anyway?

comment:14 Changed 9 years ago by larryv (Lawrence Velázquez)

This is turning into Whac-a-Mole. Clang’s executables all appear to be overlinked:

/opt/local/libexec/llvm-3.6/bin/c-index-test:
	@rpath/libclang.dylib (compatibility version 1.0.0, current version 0.0.0)
	@rpath/libLLVM-3.6svn.dylib (compatibility version 0.0.0, current version 0.0.0)
	/opt/local/lib/libz.1.dylib (compatibility version 1.0.0, current version 1.2.8)
	/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1213.0.0)
	/opt/local/lib/libffi.6.dylib (compatibility version 7.0.0, current version 7.4.0)
	/opt/local/lib/libedit.0.dylib (compatibility version 1.0.0, current version 1.51.0)
	/opt/local/lib/libncurses.5.dylib (compatibility version 5.0.0, current version 5.0.0)
	/opt/local/lib/libxml2.2.dylib (compatibility version 12.0.0, current version 12.2.0)
	/usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 120.0.0)
/opt/local/libexec/llvm-3.6/bin/clang:
	@rpath/libLLVM-3.6svn.dylib (compatibility version 0.0.0, current version 0.0.0)
	/opt/local/lib/libz.1.dylib (compatibility version 1.0.0, current version 1.2.8)
	/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1213.0.0)
	/opt/local/lib/libffi.6.dylib (compatibility version 7.0.0, current version 7.4.0)
	/opt/local/lib/libedit.0.dylib (compatibility version 1.0.0, current version 1.51.0)
	/opt/local/lib/libncurses.5.dylib (compatibility version 5.0.0, current version 5.0.0)
	/usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 120.0.0)
/opt/local/libexec/llvm-3.6/bin/clang-apply-replacements:
	@rpath/libLLVM-3.6svn.dylib (compatibility version 0.0.0, current version 0.0.0)
	/opt/local/lib/libz.1.dylib (compatibility version 1.0.0, current version 1.2.8)
	/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1213.0.0)
	/opt/local/lib/libffi.6.dylib (compatibility version 7.0.0, current version 7.4.0)
	/opt/local/lib/libedit.0.dylib (compatibility version 1.0.0, current version 1.51.0)
	/opt/local/lib/libncurses.5.dylib (compatibility version 5.0.0, current version 5.0.0)
	/usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 120.0.0)
/opt/local/libexec/llvm-3.6/bin/clang-format:
	@rpath/libLLVM-3.6svn.dylib (compatibility version 0.0.0, current version 0.0.0)
	/opt/local/lib/libz.1.dylib (compatibility version 1.0.0, current version 1.2.8)
	/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1213.0.0)
	/opt/local/lib/libffi.6.dylib (compatibility version 7.0.0, current version 7.4.0)
	/opt/local/lib/libedit.0.dylib (compatibility version 1.0.0, current version 1.51.0)
	/opt/local/lib/libncurses.5.dylib (compatibility version 5.0.0, current version 5.0.0)
	/usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 120.0.0)
/opt/local/libexec/llvm-3.6/bin/clang-modernize:
	@rpath/libLLVM-3.6svn.dylib (compatibility version 0.0.0, current version 0.0.0)
	/opt/local/lib/libz.1.dylib (compatibility version 1.0.0, current version 1.2.8)
	/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1213.0.0)
	/opt/local/lib/libffi.6.dylib (compatibility version 7.0.0, current version 7.4.0)
	/opt/local/lib/libedit.0.dylib (compatibility version 1.0.0, current version 1.51.0)
	/opt/local/lib/libncurses.5.dylib (compatibility version 5.0.0, current version 5.0.0)
	/usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 120.0.0)
Last edited 9 years ago by larryv (Lawrence Velázquez) (previous) (diff)

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

Cc: jeremyhu@… added; larryv@… removed
Owner: changed from jeremyhu@… to larryv@…

Ok, let's just add the new dependencies. Since you've been looking at it, can you add them as appropriate?

comment:16 in reply to:  15 Changed 9 years ago by larryv (Lawrence Velázquez)

Yup, working on it.

comment:17 Changed 9 years ago by larryv (Lawrence Velázquez)

Port: clang-3.3 clang-3.4 clang-3.5 clang-3.6 added
Status: newassigned
Summary: llvm-*: libLTO uses libedit, ncurses, zlib without declaring dependenciesllvm-*, clang-*: all binaries are overlinked to libedit, libffi, ncurses, and zlib

Changed 9 years ago by facardillo@…

Attachment: main.log.gz added

Log of libedit install

comment:18 Changed 9 years ago by facardillo@…

I have the same problem as the original author: libedit not found.

However, if I try and install libedit (after trying to install gcc49) I got error messages related to differing checksums.

The log file has been generated by the third step of the following sequence of commands:

  • port install gcc49 (failed due to missing libedit)
  • port install libedit (exit with success)
  • port install gcc49 (fails with the log file I attached)

Regards

Last edited 9 years ago by facardillo@… (previous) (diff)

comment:19 in reply to:  18 Changed 9 years ago by larryv (Lawrence Velázquez)

Clean libgcc and try installing again. If that fails, open another ticket; this ticket is not about GCC.

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

Cc: nmsnoopy@… added

Has duplicate #46178.

comment:21 Changed 9 years ago by larryv (Lawrence Velázquez)

“Fixed” the 3.4, 3.5, and 3.6 ports in r129359.

comment:22 Changed 9 years ago by dershow

I just tried to update openmodelica, and now I am getting an error at configure.

sudo port  upgrade  openmodelica-devel  build.jobs=4
--->  Computing dependencies for openmodelica-devel
--->  Fetching archive for openmodelica-devel
--->  Attempting to fetch openmodelica-devel-23769_0+gfortran48+libraries+modelica3d+qt+sundials.darwin_13.x86_64.tbz2 from http://packages.macports.org/openmodelica-devel
--->  Attempting to fetch openmodelica-devel-23769_0+gfortran48+libraries+modelica3d+qt+sundials.darwin_13.x86_64.tbz2 from http://mse.uk.packages.macports.org/sites/packages.macports.org/openmodelica-devel
--->  Attempting to fetch openmodelica-devel-23769_0+gfortran48+libraries+modelica3d+qt+sundials.darwin_13.x86_64.tbz2 from http://nue.de.packages.macports.org/macports/packages/openmodelica-devel
--->  Fetching distfiles for openmodelica-devel
--->  Verifying checksums for openmodelica-devel
--->  Extracting openmodelica-devel
--->  Configuring openmodelica-devel
Error: Failed to configure openmodelica-devel, consult /opt/local/var/macports/build/_opt_local_var_macports_sources_build.openmodelica.org_macports_lang_openmodelica-devel/openmodelica-devel/work/openmodelica_23769/config.log
Error: org.macports.configure for port openmodelica-devel returned: configure failure: command execution failed
Please see the log file for port openmodelica-devel for details:
    /opt/local/var/macports/logs/_opt_local_var_macports_sources_build.openmodelica.org_macports_lang_openmodelica-devel/openmodelica-devel/main.log
Error: Unable to upgrade port: 1
To report a bug, follow the instructions in the guide:
    http://guide.macports.org/#project.tickets

I am still on 10.9.5. Just adds to the "Whac-a-Mole" situation. I am not sure if this is connected to the above problem and fixes....

comment:23 in reply to:  22 Changed 9 years ago by larryv (Lawrence Velázquez)

It’s impossible to say without actually seeing your logs, but I highly doubt it. Please clean and try upgrading again, and if that fails, open a new ticket and attach your main.log there.

Changed 9 years ago by dershow

Attachment: config.log added

comment:24 Changed 9 years ago by dershow

I had tried to clean first. But, it doesn't even make it to generate the main.log, since it fails at configure. So, I have attached the configure log. I did recently install octave, which installed llvm-3.4, when I had 3.3 installed before. perhaps related? But, I did try to select 3.3, and got similar results. I did upgrade a few days ago, with no problem, so that is why I thought that "fix" two days ago to llvm might be related.

comment:25 in reply to:  24 Changed 9 years ago by larryv (Lawrence Velázquez)

This is the failure:

configure:6026: checking LAPACK/BLAS flags
configure:6060: /usr/bin/clang -o conftest -pipe -Os -arch x86_64 -fno-stack-protector -I/opt/local/include -L/opt/local/lib -Wl,-headerpad_max_install_names -arch x86_64 conftest.c -llapack -lblas >&5
Undefined symbols for architecture x86_64:
  "_ATL_dger", referenced from:
      _ATL_dgetf2 in liblapack.a(ATL_dgetf2.o)
  "_ATL_xerbla", referenced from:
      _atl_f77wrap_dgesv_ in liblapack.a(ATL_f77wrap_dgesv.o)
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
configure:6060: $? = 1
configure: failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME "OpenModelica"
| #define PACKAGE_TARNAME "openmodelica"
| #define PACKAGE_VERSION "dev"
| #define PACKAGE_STRING "OpenModelica dev"
| #define PACKAGE_BUGREPORT "https://trac.openmodelica.org/OpenModelica"
| #define PACKAGE_URL "https://openmodelica.org"
| #define YYTEXT_POINTER 1
| #define STDC_HEADERS 1
| #define HAVE_SYS_TYPES_H 1
| #define HAVE_SYS_STAT_H 1
| #define HAVE_STDLIB_H 1
| #define HAVE_STRING_H 1
| #define HAVE_MEMORY_H 1
| #define HAVE_STRINGS_H 1
| #define HAVE_INTTYPES_H 1
| #define HAVE_STDINT_H 1
| #define HAVE_UNISTD_H 1
| #define HAVE_SYS_TIME_H 1
| #define HAVE_VPRINTF 1
| #define HAVE_GETCWD 1
| #define HAVE_SELECT 1
| #define HAVE_STRDUP 1
| #define HAVE_STRERROR 1
| /* end confdefs.h.  */
| 
| /* Override any GCC internal prototype to avoid an error.
|    Use char because int might match the return type of a GCC
|    builtin and then its argument prototype would still apply.  */
| #ifdef __cplusplus
| extern "C"
| #endif
| char dgesv_ ();
| int
| main ()
| {
| return dgesv_ ();
|   ;
|   return 0;
| }
configure:6063: error: dgesv (LAPACK) linking failed using -llapack -lblas

This has nothing to do with LLVM. Please open a new ticket.

comment:26 Changed 9 years ago by dershow

New ticket opened: #46228

Last edited 4 years ago by ryandesign (Ryan Carsten Schmidt) (previous) (diff)

comment:27 in reply to:  14 Changed 7 years ago by larryv (Lawrence Velázquez)

Informational update: The CMake build seems to have eliminated this problem. I’ll probably revisit the dependencies soon.

% otool -L /opt/local/libexec/llvm-3.8/bin/{c-index-test,clang,clang-apply-replacements,clang-format}
/opt/local/libexec/llvm-3.8/bin/c-index-test:
	@rpath/libLLVM.dylib (compatibility version 1.0.0, current version 3.8.1)
	@rpath/libclang.dylib (compatibility version 1.0.0, current version 3.8.1)
	/opt/local/lib/libxml2.2.dylib (compatibility version 12.0.0, current version 12.4.0)
	/usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 307.4.0)
	/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1238.0.0)
/opt/local/libexec/llvm-3.8/bin/clang:
	@rpath/libLLVM.dylib (compatibility version 1.0.0, current version 3.8.1)
	/usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 307.4.0)
	/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1238.0.0)
/opt/local/libexec/llvm-3.8/bin/clang-apply-replacements:
	@rpath/libLLVM.dylib (compatibility version 1.0.0, current version 3.8.1)
	/usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 307.4.0)
	/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1238.0.0)
/opt/local/libexec/llvm-3.8/bin/clang-format:
	@rpath/libLLVM.dylib (compatibility version 1.0.0, current version 3.8.1)
	/usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 307.4.0)
	/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1238.0.0)

comment:28 Changed 4 years ago by kencu (Ken)

Cc: kencu added

comment:29 Changed 4 years ago by kencu (Ken)

Resolution: fixed
Status: assignedclosed

these were all fixed as of the cmake build system (clang-3.8). The < 3.8 versions we're just leaving alone.

Note: See TracTickets for help on using tickets.