dxxb / sim-arduboy

Arduboy board implementation using simavr
GNU General Public License v3.0
22 stars 8 forks source link

Linking with libsimavr on Linux #6

Closed dlancer closed 6 years ago

dlancer commented 6 years ago

Current Makefile use dynamic linking, so before we can run sim_arduboy, compiled libsimavr library should be installed to system, because at least Ubuntu 18.04 still have outdated libsimavr package in the repository without atmega32u4 support.

There is also two possible solutions without library installation:

  1. library path setup
    > LD_LIBRARY_PATH=path_to_directory_with_complied_libsimavr ./sim_arduboy app.hex
  2. static linking
    LDFLAGS += -L${simavr}/${SIMAVR-OBJ} -l:libsimavr.a

    Not sure if this should be mentioned to README or Makefile should be updated for Linux build...

dxxb commented 6 years ago

I have to look into this before I make a decision but this is what I am thinking right now: by default I'd like sim-arduboy to link statically to the version of libsimavr it comes bundled with. If one day we added support for DEB packages then dynamic linking (with the right libsimavr version dependency) would make sense.

dlancer commented 6 years ago

I can update my PR https://github.com/dxxb/sim-arduboy/pull/4 for static linking if you agree.

dxxb commented 6 years ago

Thank you @dlancer but please hold that off until I had a chance of looking into this issue and test it myself.

dlancer commented 6 years ago

Sure, no problem.