On Wed, Aug 14, 2019 at 04:10:17PM -0400, Thomas Dickey wrote: > On Wed, Aug 14, 2019 at 12:22:44PM -0500, Robert Smith wrote: > > Thank you for the hard work on this Thomas. Have we heard anything back > > from > > OpenBSD team on this? > > nothing. My cc' on the weekend was returned, and I attempted to subscribe > using the link which the majordomo gave without success. > > But visiting > > https://lists.openbsd.org/cgi-bin/mj_wwwusr?user=&passw=&func=lists-long-full&extra=bugs > > and subscribing there got it to accept it. (today). Then I bounced my > mail at the mailing list, to see if that would work, but went to find > an archive - found here > > http://openbsd-archive.7691.n7.nabble.com/openbsd-dev-bugs-f183916.html > > ...which appears to have my earlier attempt actually succeeded. > > (I didn't use sendbug, because my mail routing is a little complicated, > and I only keep it working on the Debian machines). > > > I see progress made on several different parts, but I'm not of any wholistic > > solution to get this to link correctly. > > > > I'm going to give the spec file a shot. > > I think that if you added that to the $CFLAGS, it would work (sort of ugly, > but a workaround)
I noticed that there's an OpenBSD 6.6 from October. However, this linker defect exists in that version as well. Since my message to bugs@openbsd.org was ignored, I'll have to assume that they're not interested in discussing it, and will keep in mind to document it as a pitfall in upcoming releases. > > -Robert > > > > > > > On Aug 10, 2019, at 5:19 PM, Thomas Dickey <dic...@his.com> wrote: > > > > > > On Mon, Jul 22, 2019 at 10:21:28AM +0900, Robert Smith wrote: > > >> Dear Thomas, here is my build script for 5.9, when I change the source > > >> file to 6.1 all it does it duplicate this 5.6 file to a 6.1 file, and I > > >> have to manually add any tweaks if necessary. > > >> > > >> root@h1up:/usr/src/build_system_v2/build_scripts# cat ncurses-5.9_ug > > >> echo Compiling and Installing ncurses-5.9 > > > > > > I revisited this, and can see half of the problem, which offers a > > > different > > > workaround. Comparing the specs files for the compiler in 6.2 and 6.5, > > > I see that someone added a fallback for -L/usr/lib, apparently to > > > compensate > > > for some other change. > > > > > > I'm looking at this file: > > > /usr/lib/gcc-lib/amd64-unknown-openbsd6.5/4.2.1/specs > > > > > > which has a line with this information: > > > %{!static:--eh-frame-hdr} %{!shared:%{!nostdlib:%{!r*:%{!e*:-e > > > __start}}}} %{shared:-shared} %{R*} %{static:-Bstatic} > > > %{!static:-Bdynamic} %{rdynamic:-export-dynamic} %{assert*} > > > %{!dynamic-linker:-dynamic-linker /usr/libexec/ld.so} > > > %{!nostdlib:-L/usr/lib} > > > > > > That > > > %{!nostdlib:-L/usr/lib} > > > > > > is the added text. Using ktrace, I could see that the arguments passed > > > to collect2 (part of the compiler) put a "-L/usr/lib" before any of the > > > command-line arguments: > > > > > > [0] = "/usr/lib/gcc-lib/amd64-unknown-openbsd6.5/4.2.1/collect2" > > > [1] = "--eh-frame-hdr" > > > [2] = "-e" > > > [3] = "__start" > > > [4] = "-Bdynamic" > > > [5] = "-dynamic-linker" > > > [6] = "/usr/libexec/ld.so" > > > [7] = "-L/usr/lib" > > > [8] = "-o" > > > [9] = "clear" > > > [10] = "/usr/lib/crt0.o" > > > [11] = "/usr/lib/crtbegin.o" > > > [12] = "-L../lib" > > > [13] = "-L/usr/lib/gcc-lib/amd64-unknown-openbsd6.5/4.2.1" > > > [14] = "../obj_s/clear.o" > > > [15] = "../obj_s/clear_cmd.o" > > > [16] = "../obj_s/tty_settings.o" > > > [17] = "-lncurses" > > > [18] = "-lgcc" > > > [19] = "-lc" > > > [20] = "-lgcc" > > > [21] = "/usr/lib/crtend.o" > > > > > > So the loader gets libncurses.so immediately without bothering to pay > > > any attention to its parameters. > > > > > > Just reverting that change doesn't work (won't link), so I can see it's > > > just half the story. But it's enough to see that it probably wasn't > > > intended behavior. > > > > > > You might want to open a bug report with the OpenBSD developers here: > > > > > > http://www.openbsd.org/report.html > > > > > > (cc'ing them, anyway). > > > > > > According to > > > > > > https://gcc.gnu.org/onlinedocs/gcc/Spec-Files.html > > > > > > you could make a custom "specs" file with a -L../lib before the > > > -L/usr/lib, > > > using the "-specs=" flag and pass that in your $CFLAGS > > > > > > (In a quick check, that works for me). > > > > > > -- > > > Thomas E. Dickey <dic...@invisible-island.net> > > > https://invisible-island.net > > > ftp://ftp.invisible-island.net > > > > -- > Thomas E. Dickey <dic...@invisible-island.net> > https://invisible-island.net > ftp://ftp.invisible-island.net -- Thomas E. Dickey <dic...@invisible-island.net> https://invisible-island.net ftp://ftp.invisible-island.net
signature.asc
Description: PGP signature