Add a New Comment (Rich Markup)
Comment Type & Canned Response: None None > Multiple Canned Responses Fixed in development Crash with no stack trace Already fixed in newer version Fixed in stable Bad description Bad description and crash Bad stack trace Obsolete version Duplicate and not fixed Duplicate and needs more info Duplicate and fixed Need info and old
No complaints during the week that this was pushed and the motivating example now compiles.
Closing as fixed for now.
I reverted 79369ad5cee6 here: https://hg.savannah.gnu.org/hgweb/octave/rev/bae2381fb80a
And pushed another patch to the stable branch that re-orders the linker flags here: https://hg.savannah.gnu.org/hgweb/octave/rev/fc9b98382ea7
I hope we finally got this right and can get rid of LFLAGS in Octave 9. Marking as ready for test.
When passing `-l` flags in the command line to `mkoctfile`, they are added after `LDFLAGS` in the command line passed to the linker. But libraries that resolve symbols must appear after other libraries that use these symbols.
Currently packages are setting `LFLAGS` instead of `LDFLAGS`. Presumably because we are adding the former after manual `-l` flags in the command line to the linker.
`LFLAGS` was removed in Octave 8. I tried to fix compiling the ltfat package by setting `LDFLAGS` instead. But that didn't work:
/home/osboxes/Documents/Repositories/Octave/mxe-octave/usr/bin/x86_64-w64-mingw32-mkoctfile --verbose -strip -I../src/modules/libltfat/include -DNDEBUG -L../lib -lltfat comp_atrousfilterbank_td.cc x86_64-w64-mingw32-g++ -c -I/home/osboxes/Documents/Repositories/Octave/mxe-octave/usr/x86_64-w64-mingw32/include -I/home/osboxes/Documents/Repositories/Octave/mxe-octave/usr/x86_64-w64-mingw32/include/octave-8.0.0/octave/.. -I/home/osboxes/Documents/Repositories/Octave/mxe-octave/usr/x86_64-w64-mingw32/include/octave-8.0.0/octave -I/home/osboxes/Documents/Repositories/Octave/mxe-octave/usr/x86_64-w64-mingw32/include -pthread -fopenmp -g -O2 -std=gnu++11 -Wall -DLTFAT_LARGEARRAYS -DLTFAT_BUILD_STATIC -DMINGW=1 -I../src/modules/libltfat/include -DNDEBUG comp_atrousfilterbank_td.cc -o /tmp/oct-MgVRx0.o x86_64-w64-mingw32-g++ -I/home/osboxes/Documents/Repositories/Octave/mxe-octave/usr/x86_64-w64-mingw32/include/octave-8.0.0/octave/.. -I/home/osboxes/Documents/Repositories/Octave/mxe-octave/usr/x86_64-w64-mingw32/include/octave-8.0.0/octave -I/home/osboxes/Documents/Repositories/Octave/mxe-octave/usr/x86_64-w64-mingw32/include -pthread -fopenmp -g -O2 -std=gnu++11 -Wall -DLTFAT_LARGEARRAYS -DLTFAT_BUILD_STATIC -DMINGW=1 -o comp_atrousfilterbank_td.oct /tmp/oct-MgVRx0.o -shared -Wl,--export-all-symbols -Wl,--enable-auto-import -Wl,--enable-runtime-pseudo-reloc -L/home/osboxes/Documents/Repositories/Octave/mxe-octave/usr/x86_64-w64-mingw32/lib -L"/home/osboxes/Documents/Repositories/Octave/mxe-octave/usr/x86_64-w64-mingw32/lib" -L"/home/osboxes/Documents/Repositories/Octave/mxe-octave/usr/x86_64-w64-mingw32/qt5/lib" -L/home/osboxes/Documents/Repositories/Octave/mxe-octave/usr/lib/gcc/x86_64-w64-mingw32/11.2.0 -L/home/osboxes/Documents/Repositories/Octave/mxe-octave/usr/lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../x86_64-w64-mingw32/lib/../lib -L/home/osboxes/Documents/Repositories/Octave/mxe-octave/usr/lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../x86_64-w64-mingw32/lib -lm -lgfortran -lmingw32 -lmoldname -lmingwex -lmsvcrt -lkernel32 -lquadmath -lkernel32 -lpthread -ladvapi32 -lshell32 -luser32 -lkernel32 -lkernel32 -lkernel32 -llapack -lblas -lxerbla -L/home/osboxes/Documents/Repositories/Octave/mxe-octave/usr/x86_64-w64-mingw32/lib -lfftw3 -L/home/osboxes/Documents/Repositories/Octave/mxe-octave/usr/x86_64-w64-mingw32/lib -lfftw3f -L../lib -lltfat -L/home/osboxes/Documents/Repositories/Octave/mxe-octave/usr/x86_64-w64-mingw32/lib/octave/8.0.0 -loctinterp -loctave -Wl,-rpath-link,"/home/osboxes/Documents/Repositories/Octave/mxe-octave/usr/x86_64-w64-mingw32/lib" -L"/home/osboxes/Documents/Repositories/Octave/mxe-octave/usr/x86_64-w64-mingw32/lib" -L"/home/osboxes/Documents/Repositories/Octave/mxe-octave/usr/x86_64-w64-mingw32/qt5/lib" -Wl,--export-all-symbols /home/osboxes/Documents/Repositories/Octave/mxe-octave/usr/bin/x86_64-w64-mingw32-ld: ../lib/libltfat.a(dmemalloc.o):memalloc.c:(.text+0xb9): undefined reference to `fftw_malloc' /home/osboxes/Documents/Repositories/Octave/mxe-octave/usr/bin/x86_64-w64-mingw32-ld: ../lib/libltfat.a(dmemalloc.o):memalloc.c:(.text+0xc9): undefined reference to `fftw_free' /home/osboxes/Documents/Repositories/Octave/mxe-octave/usr/bin/x86_64-w64-mingw32-ld: ../lib/libltfat.a(dmemalloc.o):memalloc.c:(.text+0x161): undefined reference to `fftw_malloc' /home/osboxes/Documents/Repositories/Octave/mxe-octave/usr/bin/x86_64-w64-mingw32-ld: ../lib/libltfat.a(dmemalloc.o):memalloc.c:(.text+0x1b1): undefined reference to `fftw_malloc' /home/osboxes/Documents/Repositories/Octave/mxe-octave/usr/bin/x86_64-w64-mingw32-ld: ../lib/libltfat.a(dmemalloc.o):memalloc.c:(.text+0x41): undefined reference to `fftw_malloc' /home/osboxes/Documents/Repositories/Octave/mxe-octave/usr/bin/x86_64-w64-mingw32-ld: ../lib/libltfat.a(dmemalloc.o):memalloc.c:(.text+0x1d1): undefined reference to `fftw_free' /home/osboxes/Documents/Repositories/Octave/mxe-octave/usr/bin/x86_64-w64-mingw32-ld: ../lib/libltfat.a(dmemalloc.o):memalloc.c:(.text+0x201): undefined reference to `fftw_free' collect2: error: ld returned 1 exit status
Note that `-lltfat` appears after `-lfftw3` in the linker command. It must be the other way round for it to work.
We should probably exchange the order in which we add linker flags (already for Octave 7):
diff -r 15ae4d97a632 src/mkoctfile.in.cc --- a/src/mkoctfile.in.cc Fri Nov 26 22:08:49 2021 +0100 +++ b/src/mkoctfile.in.cc Fri Nov 26 23:57:30 2021 +0100 @@ -1320,7 +1320,7 @@ = (vars["CXXLD"] + ' ' + vars["CPPFLAGS"] + ' ' + vars["ALL_CXXFLAGS"] + ' ' + vars["RDYNAMIC_FLAG"] + ' ' + pass_on_options + ' ' + output_option + ' ' + objfiles + ' ' - + libfiles + ' ' + vars["ALL_LDFLAGS"] + ' ' + ldflags + ' ' + + libfiles + ' ' + ldflags + ' ' + vars["ALL_LDFLAGS"] + ' ' + vars["LFLAGS"] + ' ' + octave_libs + ' ' + vars["OCTAVE_LINK_OPTS"] + ' ' + vars["OCTAVE_LINK_DEPS"]); @@ -1349,8 +1349,8 @@ std::string cmd = (vars["CXXLD"] + ' ' + vars["ALL_CXXFLAGS"] + ' ' + pass_on_options + " -o " + octfile + ' ' + objfiles + ' ' - + libfiles + ' ' + vars["DL_LDFLAGS"] + ' ' + vars["LDFLAGS"] + ' ' - + ldflags + ' ' + vars["LFLAGS"] + ' ' + octave_libs + ' ' + + libfiles + ' ' + ldflags + ' ' + vars["DL_LDFLAGS"] + ' ' + + vars["LDFLAGS"] + ' ' + vars["LFLAGS"] + ' ' + octave_libs + ' ' + vars["OCT_LINK_OPTS"] + ' ' + vars["OCT_LINK_DEPS"]); #if defined (OCTAVE_USE_WINDOWS_API) || defined(CROSS)
Since `LDFLAGS` can still not be used correctly in current versions of Octave, we should probably revert 79369ad5cee6 (for Octave 8) and delay removing `LFLAGS` for at least one or two more major versions.
(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)
Attach Files: Comment:
No files currently attached
Depends on the following items: None found
Items that depend on this one: None found
There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.
Only project members can vote.
Please enter the title of George Orwell's famous dystopian book (it's a date):
Follow 3 latest changes.
Copyright © 2022 Free Software Foundation, Inc. Verbatim copying and distribution of this entire article is permitted in any medium, provided this notice is preserved. The Levitating, Meditating, Flute-playing Gnu logo is a GNU GPL'ed image provided by the Nevrax Design Team. Source Code
Powered by Savane 3.9