Giter Site home page Giter Site logo

Comments (3)

dakami avatar dakami commented on July 3, 2024

Alas, neither Ubuntu 12 or Ubuntu 14 can build wcc anymore.

from wcc.

endrazine avatar endrazine commented on July 3, 2024

Hi @dakami,
I suspect the second bug comes from the fact that python and /bin/ls have the same load base address, hence a load conflict. We could verify this assumption by attempting to give a non standard base address to the python interpreter, like done with wsh. The linker script is located here : https://github.com/endrazine/wcc/blob/master/src/wsh/script.lds

OSError: ls.so: undefined symbol: fgetfilecon

This is a different matter : the function fgetfilecon() isn't found by the dynamic linker when loading the library. Loading the corresponding library before loading ls.so should do the trick. Alternatively, you could try to tell gcc where to find this library when linking ls.so, so the import section of the resulting library contains a reference to the said shared library and the dynamic linker knows it needs to load it in memory when loading ls.so in the address space.

Note that you don't actually need to libify the library before loading it into wsh anymore, simply starting wsh with "wsh /bin/ls" should load the library entirely.

from wcc.

endrazine avatar endrazine commented on July 3, 2024

Hi Dan,

You don't need to use wcc before libifying using wld. See below:

jonathan@blackbox:/tmp/dan$ cp /bin/ls ./ls.so
jonathan@blackbox:/tmp/dan$ wld -libify ./ls.so
jonathan@blackbox:/tmp/dan$ file ls.so
ls.so: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/l, for GNU/Linux 3.2.0, BuildID[sha1]=9567f9a28e66f4d7ec4baf31cfbf68d0410f0ae6, stripped
jonathan@blackbox:/tmp/dan$ python
Python 2.7.15rc1 (default, Nov 12 2018, 14:31:15)
[GCC 7.3.0] on linux2
Type "help", "copyright", "credits" or "license" for more information.

from ctypes import *
cdll.LoadLibrary("./ls.so")
<CDLL './ls.so', handle 559cd0aaa9d0 at 7fb3554c7190>

It works \o/

from wcc.

Related Issues (20)

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.