Opened 13 months ago

Last modified 5 months ago

#1818 new defect

Exporting a macro inhibits compiled program from locating libraries

Reported by: Filip Jagiełłowicz Owned by:
Priority: major Milestone: someday
Component: compiler Version: 5.3.0
Keywords: Cc:
Estimated difficulty:

Description

The bug I found makes the compiled program unable to locate libraries
based on the environment variables CHICKEN_INCLUDE_PATH and
CHICKEN_REPOSITORY_PATH.

The bug is quite fiddly to reproduce so I've added a 7z archive that
contains the neccessary file structure and sets the environment
variables appropriately. To compile and run it execute the make.sh
script.

The program runs as expected as long as the 5. line (exporting the
macro) in the test.scm file is commented out, but fails to load the
testlib library if it's included.

What makes the bug so fiddly and likely the reason why it hasn't been
noticed so far is that everything works as expected as long as the
include *.import.scm files and the library *.so files are in the same
directory, as pointed by CHICKEN_REPOSITORY_PATH. This can be observed
by commenting out the 8. line in the make.sh script.

Therefore I hope it's a simple error in using a wrong variable to get
the search directory for the *.import.scm files.

Lastly, I've run it on Arch Linux updated as of 2023.03.30:

$ chicken-csc -version
CHICKEN
(c) 2008-2021, The CHICKEN Team
(c) 2000-2007, Felix L. Winkelmann
Version 5.3.0 (rev e31bbee5)
linux-unix-gnu-x86-64 [ 64bit dload ptables ]

Attachments (1)

load_library_bug.7z (848 bytes) - added by Filip Jagiełłowicz 13 months ago.

Download all attachments as: .zip

Change History (4)

Changed 13 months ago by Filip Jagiełłowicz

Attachment: load_library_bug.7z added

comment:1 Changed 6 months ago by felix winkelmann

Milestone: someday6.0.0

comment:2 Changed 5 months ago by felix winkelmann

The script doesn't export the environment variables, so they are not seen at all during compile and run-time. I tried with and without exporting the macro but that doesn't seem to make any difference. Also, CHICKEN_INCLUDE_PATH is not necessary, you can just set CHICKEN_REPOSITORY_PATH to lib (+ the default one, as you correctly do).

comment:3 Changed 5 months ago by felix winkelmann

Milestone: 6.0.0someday
Note: See TracTickets for help on using tickets.