Giter Site home page Giter Site logo

Linking troubles when building about wcc HOT 8 CLOSED

endrazine avatar endrazine commented on July 22, 2024
Linking troubles when building

from wcc.

Comments (8)

lgbaldoni avatar lgbaldoni commented on July 22, 2024 2

I was creating a rpm package. Things to link to system libraries when possible, fix installation paths, compilation flags and a few other minor details.

from wcc.

lgbaldoni avatar lgbaldoni commented on July 22, 2024 1

None whatsoever. The project looks abandoned.

from wcc.

rofl0r avatar rofl0r commented on July 22, 2024 1

libbfd which is used by this project is pretty volatile. it's part of binutils and afaict there's no stable ABI (so imo it's been a pretty bad choice to use it for this project). anyway, the issues you're experiencing may be related to that your libbfd is a static lib (libbfd.a), not a dynamic lib, so dependencies aren't pulled in automatically. most of the symbols i see missing seem to be from libiberty, which is another GNU library (used by gcc and binutils) not really meant to be used by external projects. maybe adding -liberty -lz -ldl -lc to the command line could fix it, but i would look into getting a dynamic build of libbfd.

from wcc.

orcephrye avatar orcephrye commented on July 22, 2024

I too am stuck when adding '-lz'. Running OpenSuSE Tumbleweed. Have you had any progress since posting this?

from wcc.

lgbaldoni avatar lgbaldoni commented on July 22, 2024

And that, among other things, did the trick, TYVM.

from wcc.

rofl0r avatar rofl0r commented on July 22, 2024

And that, among other things, did the trick, TYVM.

what exactly ?

from wcc.

endrazine avatar endrazine commented on July 22, 2024

Hi Luigino and rofl0r,
As noted by rofl0r, the symbols that trigger an error, such as "objalloc_free_block" are not called from wcc. The linking problem would come from a problem when building libbfd/libopcode.
I am glad to hear you managed to solve the matter by linking against a version of libbfd that is a shared library instead of a static library. I was about to suggest you built against this version: ftp://sourceware.org/pub/binutils/snapshots/binutils-2.31.90.tar.xz
using the following steps:
wget -c ftp://sourceware.org/pub/binutils/snapshots/binutils-2.31.90.tar.xz
tar -xvJf binutils-2.31.90.tar.xz
mkdir build -p
cd build
../binutils-2.31.90/configure --with-sysroot=/ --enable-shared --enable-targets=all --build=x86_64-linux-gnu --host=x86_64-linux-gnu --enable-plugins --prefix=/usr --enable-ld=default --enable-gold --enable-multilib build_alias=x86_64-linux-gnu host_alias=x86_64-linux-gnu
make -j8
make install

I'm glad you could solve it by yourself \o/

from wcc.

endrazine avatar endrazine commented on July 22, 2024

Linking problem solved.
For future reference, the following steps to build binutils, libbfd and libopcode are known to work :

wget -c ftp://sourceware.org/pub/binutils/snapshots/binutils-2.31.90.tar.xz
tar -xvJf binutils-2.31.90.tar.xz
rm -rf ./build/
mkdir build -p
cd build
../binutils-2.31.90/configure --with-sysroot=/ --enable-shared --enable-targets=all --build=x86_64-linux-gnu --host=x86_64-linux-gnu --enable-plugins --prefix=/usr --enable-ld=default --enable-gold --enable-multilib build_alias=x86_64-linux-gnu host_alias=x86_64-linux-gnu
make -j8
make install

from wcc.

Related Issues (19)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.