Project

General

Profile

Actions

Bug #4562

closed

Need a package to deliver GCC runtime libraries

Added by Gary Mills over 7 years ago. Updated about 7 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
OI-Userland
Target version:
-
Start date:
2014-02-03
Due date:
% Done:

100%

Estimated time:
4.00 h
Difficulty:
Medium
Tags:
gcc

Description

Now that gcc is the primary compiler, building illumos fails with errors that report missing runtime libraries:

usr/bin/audioconvert: libstdc++.so.6 => (file not found) <no -zdefs?>
usr/bin/audioconvert: libgcc_s.so.1 => (file not found) <no -zdefs?>
usr/lib/amd64/libfru.so.1: libstdc++.so.6 => (file not found) <no -zdefs?>
usr/lib/amd64/libfru.so.1: libgcc_s.so.1 => (file not found) <no -zdefs?>

The necessary libraries are in /opt/gcc/4.4.4/lib and /opt/gcc/4.4.4/lib/amd64, using the compiler required for building illumos. To resolve this problem, I created two symlinks in /usr/lib and two in /usr/lib/amd64 . It would be helpful to have these symlinks delivered in a package that arrived with the compiler, rather than having to create them manually.

Actions #1

Updated by Yuri Pankov over 7 years ago

Shouldn't this be filed against the distro you are building on (and delivering the compiler)?

Actions #2

Updated by Rich Lowe over 7 years ago

You probably meant to file this against the distribution that provided your compiler. But I'm not sure which that is, because I thought they'd all also fixed this by now.

Do you want this bug moved to (I guess) OI?

Actions #3

Updated by Gary Mills over 7 years ago

The compiler package I'm using is developer/illumos-gcc from the OI development repository. As far as I can tell, there is no runtime library package available for this one.

This compiler is required for building illumos, but without runtime support, the build now produces errors.

Actions #4

Updated by Rich Lowe over 7 years ago

  • Project changed from illumos gate to OpenIndiana Distribution
Actions #5

Updated by Richard PALO over 7 years ago

well, according to the manner my request (https://www.illumos.org/issues/4134)was handled, nobody seems to want illumos-gcc runtime anywhere ... (more or less the same on omnios)

you may want to simply use crle [-64] to quickly add the paths in your build zone... this is what I used to do to bootstrap pkgsrc, for example, in absence of anything but a minimal illumos-gate build zone...

or perhaps construe LD_LIBRARY_PATH to use $CCLIBDIR (from usr/src/Makefile.master) where necessary if the libraries are indeed missing from the system default library search path.

Actions #6

Updated by Gary Mills over 7 years ago

Yes, I know that we can do things manually to resolve this unfortunate situation. The problem with manual changes is that we forget what we've changed. A package does it automatically: we don't need to figure out what was wrong or ask how to fix it. A package is a better solution.

Actions #7

Updated by Richard PALO over 7 years ago

Gary Mills wrote:

Yes, I know that we can do things manually to resolve this unfortunate situation. The problem with manual changes is that we forget what we've changed. A package does it automatically: we don't need to figure out what was wrong or ask how to fix it. A package is a better solution.

As I mentioned, I used to use this... more importantly, for illumos-gate builds (on OI) I don't need this if pkg:/system/library/g++-4-runtime is installed(which seems to be compatible).
Perhaps you are missing this package.

Actions #8

Updated by Ken Mays over 7 years ago

  • Category set to 10
  • Assignee set to OI Userland
  • Estimated time set to 4.00 h
  • Tags changed from needs-triage to gcc
Actions #9

Updated by Gary Mills over 7 years ago

That package seems not to exist in the //pkg.openindiana.org/dev/ repository. Is it someplace else?

Actions #10

Updated by Richard PALO over 7 years ago

Gary Mills wrote:

That package seems not to exist in the //pkg.openindiana.org/dev/ repository. Is it someplace else?

I guess it's in http://pkg.openindiana.org/hipster and not yet in http://pkg.openindiana.org/dev

I'm stuck in "hipster" as I blew away by accident the last "dev" BE, and can't backtrack yet.

The crle hint above in a non-global zone reserved for building the gate may be your easiest shot...

Actions #11

Updated by Andrew Stormont over 7 years ago

I think the real solution is for illumos to not depend on these libraries. They should be statically linked in.

Actions #12

Updated by Richard PALO over 7 years ago

Andrew Stormont wrote:

I think the real solution is for illumos to not depend on these libraries. They should be statically linked in.

Seems feasible, has anybody tried modifying

richard@x3200:~/src/illumos-gate/usr/src$ find . -name 'Makefile*' -exec egrep 'lstdc++|lgcc_s' {} \\; -print
$(__GNUC)CCNEEDED    = -L$(GCCLIBDIR) -lstdc++ -lgcc_s
./Makefile.master
$(__GNUC64)CCNEEDED =    -L$(GCCLIBDIR) -lstdc++
$(__GNUC64)CCNEEDED +=    -lgcc_s
./Makefile.master.64

and placing -lstdc++ and -lgcc_s between '-Wl,-Bstatic' and '-Wl,-Bdynamic' qualifiers?

Actions #13

Updated by Gary Mills over 7 years ago

Static linking to runtime libraries is the wrong way for Solaris-based systems. Dynamic linking is the correct way to proceed. The usual way to make this work when the runtime libraries are not in the search path is to add `-R' to linker command line so that their location is included in the executable.

Actions #14

Updated by Andrew Stormont over 7 years ago

The GCC runtime should be compiled into binaries supplied by illumos-gate as illumos-gate should not have a dependency on the compiler used to build it.

-static-libgcc and -static-libstdc++ option to gcc and g++ should be used.

Actions #15

Updated by Richard PALO over 7 years ago

Andrew Stormont wrote:

The GCC runtime should be compiled into binaries supplied by illumos-gate as illumos-gate should not have a dependency on the compiler used to build it.

-static-libgcc and -static-libstdc++ option to gcc and g++ should be used.

Are these not 'gcc' only options? There may still be s*studio and possibly clang users...
(trying to avoid discussion of the 'official' gcc-4.4.4-il-3 compiler)

Actions #16

Updated by Ken Mays about 7 years ago

  • Status changed from New to Closed
  • % Done changed from 0 to 100

Corrections made in hipster-070114.
Standard core-OS compiler: GCC 4.8.4

Actions

Also available in: Atom PDF