Comments (7)
It shouldn't generate any archive with BUILD_SHARED_LIBS=ON. And it shouldn't generate any archive on Windows, at all. I'm using
set_target_properties(libipt PROPERTIES
PREFIX ""
PUBLIC_HEADER ${CMAKE_CURRENT_BINARY_DIR}/include/intel-pt.h
VERSION ${PT_VERSION}
SOVERSION ${PT_VERSION_MAJOR}
)
to remove the standard lib prefix and I call the library libipt
so it comes out the same way on Linux and Windows.
It works fine in my standard environment:
W:\ipt\bugs\issue-99>cmake -G Ninja -DBUILD_SHARED_LIBS=ON -DCMAKE_INSTALL_PREFIX=install w:/ipt/git
-- The C compiler identification is MSVC 19.35.32215.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: C:/Program Files/Microsoft Visual Studio/2022/Professional/VC/Tools/MSVC/14.35.32215/bin/Hostx64/x64/cl.exe - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Found UnixCommands: C:/Program Files/Git/usr/bin/bash.exe
-- Configuring done
-- Generating done
-- Build files have been written to: W:/ipt/bugs/issue-99
W:\ipt\bugs\issue-99>cmake --build .
[27/27] Linking C shared library bin\libipt.dll
W:\ipt\bugs\issue-99>cmake --install .
-- Install configuration: "Debug"
-- Installing: W:/ipt/bugs/issue-99/install/lib/libipt.lib
-- Installing: W:/ipt/bugs/issue-99/install/bin/libipt.dll
-- Installing: W:/ipt/bugs/issue-99/install/include/intel-pt.h
And with BUILD_SHARED_LIBS=OFF I get the expected Windows .lib
.
W:\ipt\bugs\issue-99>cmake -G Ninja -DBUILD_SHARED_LIBS=OFF -DCMAKE_INSTALL_PREFIX=install w:/ipt/git
-- The C compiler identification is MSVC 19.35.32215.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: C:/Program Files/Microsoft Visual Studio/2022/Professional/VC/Tools/MSVC/14.35.32215/bin/Hostx64/x64/cl.exe - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Found UnixCommands: C:/Program Files/Git/usr/bin/bash.exe
-- Configuring done
-- Generating done
-- Build files have been written to: W:/ipt/bugs/issue-99
W:\ipt\bugs\issue-99>cmake --build .
[27/27] Linking C static library lib\libipt.lib
W:\ipt\bugs\issue-99>cmake --install .
-- Install configuration: "Debug"
-- Installing: W:/ipt/bugs/issue-99/install/lib/libipt.lib
-- Installing: W:/ipt/bugs/issue-99/install/include/intel-pt.h
Something must confuse cmake in your environment. It uses .dll
and .lib
suffixes so it should know that it is building for Windows. But then, it tries to create an archive (or just uses the .a
suffix) and it ignores the PREFIX ""
target property. Since we end up with liblibipt.dll.a
it seems to mix Windows and Linux naming conventions.
It almost looks like the lib
and .a
were added later on to the name constructed by the libipt cmakefiles.
from libipt.
.dll.a is an import library and not an archive in case of non-msvc compilers.
Setting IMPORT_PREFIX ""
seems to work here for me. Removing PREFIX ""
and setting OUTPUT_NAME "ipt"
also works here.
I don't know how that later affects builds/naming with other compilers and other platforms though.
from libipt.
Removing PREFIX ""
and setting OUTPUT_NAME "ipt"
results in ipt.dll
when building with MSVC. Setting IMPORT_PREFIX ""
seems to work.
from libipt.
@GitMensch can you confirm that setting IMPORT_PREFIX ""
fixes the issue?
from libipt.
from libipt.
See https://github.com/msys2/MINGW-packages/blob/master/mingw-w64-libipt/001-fix-import-lib-naming.patch (and yes, dropping the need for that patch would be very good).
from libipt.
Thanks, I'll update the MSYS2 build to the new release and drop the not needed patch there.
To be usable for my primary interest GDB will need adjustments, but at least people can use libipt on this environment now.
from libipt.
Related Issues (20)
- Question: How to use libipt in GDB on Windows? HOT 7
- 2.1: LTO exposes `[-Werror=maybe-uninitialized]` warnings HOT 4
- Possible discrepancy between Intel manual and implementation WRT compressed return logic. HOT 4
- `pte_bad_query` for user-space tracing across a syscall immediately followed by `ret` HOT 1
- Docs: clarify the kind of error HOT 5
- Comparisons between types of different widths in a loop condition can cause the loop to behave unexpectedly. HOT 5
- build ptxed HOT 2
- About synchronization HOT 2
- about pt record HOT 2
- ‘ptic_error’ undeclared when running "make user"
- about `--pevent:time-zero` HOT 2
- about parallel HOT 2
- How to use ptxed with the buffers generated by the perf_event_open system call? HOT 10
- `unexpected packet context` in initial sync point HOT 11
- Decoder out of sync and not enough recorded data. HOT 6
- Decoding errors when XED is not initialised correctly HOT 28
- questions about TIP.PGD with IP HOT 3
- Decoding trace in reverse execution order HOT 7
- new tag/release? HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from libipt.