9 Apr 2024 |
fastcardriver | Any idea why I am obtaining neither a .pdb file nor a .dll file? As a reminder I run these in the MSYS2 shell (with proper environment variables):
1.: $ ./configure CC="cl -nologo" CXX="$PWD/compile cl -nologo" CXXFLAGS="-EHsc" AR="lib" CPPFLAGS=-I\path\to\zlib\include LDFLAGS=-L\path\to\zlib\lib --enable-assertions
2.: make
3.: make install | 09:59:44 |
fastcardriver | * Any idea why I am obtaining neither a .pdb file nor a .dll file? As a reminder I run these in the MSYS2 shell (with proper environment variables): 1.: $ ./configure CC="cl -nologo" CXX="$PWD/compile cl -nologo" CXXFLAGS="-EHsc" AR="lib" CPPFLAGS=-I\path\to\zlib\include LDFLAGS=-L\path\to\zlib\lib --enable-assertions 2.: make 3.: make install | 10:00:07 |
| fastcardriver left the room. | 10:01:27 |
| fastcardriver joined the room. | 10:47:04 |
fastcardriver | I obtain a .pdb file now. The key was to modify the ./configure command: CXX="$PWD/compile cl -nologo -Zi" (The -Zi is new).
For more: https://stackoverflow.com/questions/4659754/the-gs-g-option-equivalent-to-vs2010-cl-compiler | 13:38:03 |
olly | Probably better to put it in CXXFLAGS | 17:41:22 |
olly | i had a look at the DLL issue - the configure code looks right, but in CI we get: | 20:03:27 |
olly | checking whether the /c/projects/xapian/xapian-core/compile cl -nologo linker (/usr/bin/ld) supports shared libraries... yes
[...]
checking if libtool supports shared libraries... no
| 20:04:14 |
olly | that's the appveyor build with is the oldest MSVC we support, but for some reason the GHA CI builds explicitly --disable-shared | 20:04:51 |
olly | I'll dig a bit more later, but it's not just you | 20:05:07 |
olly | fastcardriver: is the output of xapian-config --cxxflags empty for your MSVC build? | 22:25:09 |
olly | BTW, in your configure command above, CPPFLAGS=-I\path\to\zlib\include LDFLAGS=-L\path\to\zlib\lib won't work properly | 22:25:51 |
olly | you either need to use forward slashes / or make sure the backslashes are protected from the shell (e.g. CPPFLAGS='-I\path\to\zlib\include' LDFLAGS='-L\path\to\zlib\lib' | 22:26:33 |
olly | otherwise the shell will take each backslash as an escape for the next character and effectively throw them away to give: CPPFLAGS=-Ipathtozlibinclude LDFLAGS=-Lpathtozliblib and those paths probably don't exist so the options won't actually do anything | 22:28:29 |
10 Apr 2024 |
olly | fastcardriver adding LD=link to the configure command helps - then we get:
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
| 06:27:50 |
olly | but linking xapian-check.exe fails because a symbol which should be available from the xapian DLL isn't found | 06:28:24 |
olly | i wonder if it's wanting all that dllexport nonsense | 06:29:12 |
olly | the GNU toolchain has a --enable-runtime-pseudo-reloc linker option which means you don't need it, but I don't know if Microsoft have an equivalent | 06:33:19 |
olly | if not we might be able to use the symbol visibility macros to add the dllexport and dllimport - they also mark all the externally visible symbols | 06:41:21 |
olly | but anyway, right now it seems one can't just build a DLL out of the box | 06:41:54 |
olly | libtool manual says "With Microsoft tools, Libtool digs through the object files that make up the library, looking for non-static symbols to automatically export. I.e., Libtool with Microsoft tools tries to mimic the auto-export feature of contemporary GNU tools." | 21:45:15 |
11 Apr 2024 |
olly | adding NM=dlltool helps - the remaining issue seems to be that libtool decides to build a static library much latter in the build when it looks at linking to zlib | 22:34:16 |
olly | not poked that much, but I wonder if it's the slightly odd naming | 22:34:38 |
15 Apr 2024 |
fastcardriver | My configure command looks like this now:
$ ./configure CC="cl -nologo" CXX="$PWD/compile cl -nologo" CXXFLAGS="-EHsc -Zi" AR="lib" CPPFLAGS=-I/path/to/zlib/include LDFLAGS=-L/path/to/zlib/lib LD=link NM=dlltool
| 05:30:35 |
fastcardriver | I still get
checking if libtool supports shared libraries... no
checking whether to build shared libraries... no | 05:30:58 |
fastcardriver | xapian-config --cxxflags is empty after the configure command | 05:31:26 |
fastcardriver | * The output of xapian-config --cxxflags is empty after the configure command | 05:31:36 |
olly | what does which link report? | 05:33:09 |
olly | unhelpfully link is a Unix tool to create hardlinks and symlinks, so depending on PATH order LD=link might not get you the MSVC linker | 05:34:23 |
fastcardriver | which link outputs /usr/bin/link
So I guess I have to find the equivalent of that for Windows | 05:36:38 |