| Summary: | dev-lang/gforth-0.7.3-r1 generates image file with paths to /var/tmp/portage/... | ||
|---|---|---|---|
| Product: | Gentoo Linux | Reporter: | Tommy Pettersson <ptp> |
| Component: | Current packages | Assignee: | Sergei Trofimovich (RETIRED) <slyfox> |
| Status: | RESOLVED OBSOLETE | ||
| Severity: | minor | CC: | jstein |
| Priority: | Normal | Keywords: | PATCH |
| Version: | unspecified | ||
| Hardware: | All | ||
| OS: | Linux | ||
| Whiteboard: | |||
| Package list: | Runtime testing required: | --- | |
| Attachments: | gforth-0.7.3-includedir.patch | ||
Can you provide a minimal example to test on? Created attachment 577822 [details, diff]
gforth-0.7.3-includedir.patch
Found it on http://qualdan.com/forth/jedi-bob-1.tar.bz2 but my session seems to work: $ jedi-bob-1:gforth jedi-bob.fs <window created> What do you get if ty try this?: gforth -e 'libcc-path .path cr bye' I get: ~/.gforth/libcc-named/ /var/tmp/portage/dev-lang/gforth-0.7.3-r1/work/gforth-0.7.3/lib/gforth/0.7.3/libcc-named/ So gforth can't find /usr/lib64/gforth/0.7.3/libcc-named/fflib.la I get the same: $ gforth -e 'libcc-path .path cr bye' ~/.gforth/libcc-named/ /tmp/portage-tmpdir/portage/dev-lang/gforth-0.7.3-r1/work/gforth-0.7.3/lib/gforth/0.7.3/libcc-named/ Maybe you have the build files left in /var/tmp/portage/dev-lang/gforth-0.7.3-r1/ ? When I run strace I see that gforth tries to open /var/tmp/.../fflib.la, and when it can't find it it tries to open $HOME/.gforth/libcc-named/fflib.la, and when it can't find that either it writes a source file there and tries to compile and link it, which also fails, and I think the linking fails because the libtool command in the gforth image uses the same wrong patch to /var/tmp/portage/ I see now that I do however have a compiled socket.la there, which suggests that gforth did not find /usr/lib64/gforth/0.7.3/libcc-named/socket.la, but the compilation of $HOME/.gforth/libcc-named/socket.la succeded, and that maybe the compilation of $HOME/.gforth/libcc-named/fflib.la fails for some other reason on my computer. In any case, the build should not result in libcc-path pointing to things in /var/tmp/portage/ Oh, thank you for the hint!
I do have fflib.la and socket.la files in ~/.gforth/libcc-named. Those get recreated every time I run gforth jedi-bob.fs even if I delete them.
I agree final path should point to /usr/. Unfortunately your patch seems to break
gforth build on a system where gforth is not installed yet as:
for i in fflib.fs cstr.fs unix/socket.fs; do ./gforth -e "s\" `pwd`/lib/gforth/0.7.3/libcc-named/\" libcc-named-dir-v 2! libcc-path clear-path libcc-named-dir libcc-path also-path :noname 2drop s\" /usr/lib64/gforth/0.7.3/libcc-named/\" ; is replace-rpath" ./$i -e bye; done
/tmp/portage/dev-lang/gforth-0.7.3-r2/work/gforth-0.7.3/lib/gforth/0.7.3/libcc-named/fflib.c:1:10: fatal error: gforth/0.7.3/libcc.h: No such file or directory
1 | #include <gforth/0.7.3/libcc.h>
| ^~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
Which makes some sense as inplace paths are not consulted now.
Hardcoding would need to be fixed upstream. What do you think if we try to sort out you fflib.la failure here instead? Can you extract source file, libtool invocation and resulting error? Let's close as obsolete. Removing image path hardcoming should be done in upstream project as it changes bootstrap behaviour quite a bit. |
I was trying a gforth example which uses ffi to link to xlib, and got the following error: cc1: error: /var/tmp/portage/dev-lang/gforth-0.7.3-r1/work/gforth-0.7.3/include: Permission denied in file included from *OS command line*:-1 in file included from jedi-bob.fs:2 in file included from xlib.fs:1 in file included from /usr/share/gforth/0.7.3/lib.fs:24 /usr/share/gforth/0.7.3/fflib.fs:136: libtool compile failed >>>end-c-library<<< Backtrace: $7F1E59FCA988 throw $7F1E5A0067C0 c(abort") $7F1E5A0073D8 compile-wrapper-function1 I think the following patch should fix the problem (It does on my computer): Index: gforth-0.7.3/Makefile.in =================================================================== --- gforth-0.7.3.orig/Makefile.in +++ gforth-0.7.3/Makefile.in @@ -767,7 +767,7 @@ # -$(CP) $< $@ gforth.fi: $(kernel_fi) gforthmi gforth-ditc$(EC)$(EXE) $(GFORTH_FI_SRC) comp-i.fs - GFORTHD="./gforth-ditc -p .$(PATHSEP)$(srcdir)" GFORTH="./gforth-ditc --die-on-signal -p .$(PATHSEP)$(srcdir) -i $(kernel_fi) $(STARTUP)" includedir=`pwd`/include bindir=`pwd` libccdir=`pwd`/lib/gforth/$(VERSION)/libcc-named/ ./gforthmi gforth.fi $(FORTHSIZES) $(FORTHKFLAGS) $(STARTUP) + GFORTHD="./gforth-ditc -p .$(PATHSEP)$(srcdir)" GFORTH="./gforth-ditc --die-on-signal -p .$(PATHSEP)$(srcdir) -i $(kernel_fi) $(STARTUP)" includedir=$(includedir) bindir=`pwd` libccdir=$(libccdir) ./gforthmi gforth.fi $(FORTHSIZES) $(FORTHKFLAGS) $(STARTUP) # ------------- Make c-engine --