Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Automate readelf and verbosity #3

Merged
merged 5 commits into from
Feb 12, 2025
Merged

Conversation

memsharded
Copy link
Contributor

And readme with result details

@@ -54,6 +54,10 @@ def run(cmd):
f"-DCMAKE_INSTALL_PREFIX={install_dir}/{project} {defines} {shared_cmake} {charmander_header_cmake}")
run(f"cmake --build {build_dir}/{project} --config Release")
run(f"cmake --install {build_dir}/{project} --config Release")
if platform == "windows":
run(f"{build_dir}/squirtle/Release/hello.exe")
elif platform == "linux":
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we want otool -L ... on mac for the same?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, but I don't have a Mac to test, can be added later, this is the idea

@memsharded
Copy link
Contributor Author

Updated with the results of conan-io/conan#17459, now things look good on the linking transitive shared libraries side:

[100%] Linking CXX executable hello
/opt/cmake-3.30.5-linux-x86_64/bin/cmake -E cmake_link_script CMakeFiles/hello.dir/link.txt --verbose=1
/usr/bin/c++ -m64 -O3 -DNDEBUG -m64 CMakeFiles/hello.dir/print_hello.cpp.o -o hello  
-Wl,-rpath,/home/.conan2/p/b/bulbac8139c5804aac/p/lib:/home/.conan2/p/b/charma6ae9001b3b66/p/lib:/home/.conan2/p/b/pikaccddcbcddba2f9/p/lib 
/home/.conan2/p/b/bulbac8139c5804aac/p/lib/libbulbasaur.so 
-Wl,-rpath-link,/home/.conan2/p/b/charma6ae9001b3b66/p/lib:/home/.conan2/p/b/pikaccddcbcddba2f9/p/lib

(Full details in the README of the PR)

if self.settings.os == "Linux":
self.run(f"readelf -d {exe}")
if self.settings.os == "Windows":
self.run(f"dumpbin /DEPENDENTS {exe}.exe", env="conanrun")
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

does this work without having to find the tool? (i thought typically this only worked inside a vcvars environment)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I explicitly added a VCVars(self).generate(scope="run") in the generate() to allow this.

Copy link
Owner

@jcar87 jcar87 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@jcar87 jcar87 merged commit 556b608 into jcar87:main Feb 12, 2025
@memsharded memsharded deleted the automate_readelf branch February 12, 2025 11:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants