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

clang does not support -rpath-link #19137

Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion recipes/qt/5.x.x/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,9 @@
no_copy_source = True
short_paths = True

def _is_clang(self):
return str(self.settings.compiler) in ["clang", "apple-clang"]

@property
def _settings_build(self):
return getattr(self, "settings_build", self.settings)
Expand Down Expand Up @@ -737,7 +740,7 @@

libdirs = [l for dependency in self.dependencies.host.values() for l in dependency.cpp_info.aggregated_components().libdirs]
args.append("QMAKE_LIBDIR+=\"%s\"" % " ".join(libdirs))
if not is_msvc(self):
if not is_msvc(self) and not self._is_clang():
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this a problem on newer versions of Clang or only on version 13? If it's only an issue for 13, I think we should only do this for that version of Clang. I think we want to keep RPATH enabled otherwise.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

well, I cannot really tell, I can confirm that the issue exist for clang 13 and 14 on Macos m1

Copy link
Contributor

Choose a reason for hiding this comment

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

I beleive this is an issue with the linker and not the compiler. The linker in Apple platforms doesn't have -rpath-link, but on Linux (even with Clang), this should work.

Perhaps this conditional can be changed to if not is_msvc(self) and not is_apple_os(self): - or something along those lines.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

probably if not is_msvc(self) and not (is_apple_os(self) and self._is_clang()) : is more accurate, assuming -rpath-link is available for gcc on macos

args.append("QMAKE_RPATHLINKDIR+=\"%s\"" % ":".join(libdirs))

if "libmysqlclient" in [d.ref.name for d in self.dependencies.direct_host.values()]:
Expand Down Expand Up @@ -920,7 +923,7 @@
filecontents += 'set(CMAKE_AUTOMOC_MACRO_NAMES "Q_OBJECT" "Q_GADGET" "Q_GADGET_EXPORT" "Q_NAMESPACE" "Q_NAMESPACE_EXPORT")\n'
save(self, os.path.join(self.package_folder, self._cmake_core_extras_file), filecontents)

def _create_private_module(module, dependencies=[]):

Check warning on line 926 in recipes/qt/5.x.x/conanfile.py

View workflow job for this annotation

GitHub Actions / Lint changed conanfile.py (v2 migration)

Dangerous default value [] as argument
if "Core" not in dependencies:
dependencies.append("Core")
dependencies_string = ';'.join(f'Qt5::{dependency}' for dependency in dependencies)
Expand Down Expand Up @@ -989,7 +992,7 @@
reqs.append(corrected_req)
return reqs

def _create_module(module, requires=[], has_include_dir=True):

Check warning on line 995 in recipes/qt/5.x.x/conanfile.py

View workflow job for this annotation

GitHub Actions / Lint changed conanfile.py (v2 migration)

Dangerous default value [] as argument
componentname = f"qt{module}"
assert componentname not in self.cpp_info.components, f"Module {module} already present in self.cpp_info.components"
self.cpp_info.components[componentname].set_property("cmake_target_name", f"Qt5::{module}")
Expand Down