-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
synocli-devel updates and republish for x25 nas #6877
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
base: master
Are you sure you want to change the base?
Conversation
This causes the build-time executables to use the same RPATH as the cross-compiled bin|lib expected to run in the destination installation path causing them to fail when executed as unable to find their relative native libraries they were built against. Port from PR SynoCommunity#6867
This change avoid environment variable to bleed from on build type to another over the course of going through all the dependencies. It now allows ensuring CC,CXX,etc. aren't defined when using CMake or meson thus avoiding for NATIVE compiler and flags to inadvertently use these autotools type defined variables.
|
@hgy59 and @mreid-tt if you can have a review of this PR and in particular if you have any questions related to the framework changes involved. I tried to be as meticulous as possible to document the changes but let me know if it needs more explanations. As well, now that this is finally done (was long over-due in my todo list and will be curious if this has impacts over #6867) - I have numerous smaller changes to do to the framework. I intend to push these other individually so it makes it easy to find where said regression was injected in the framework. Lastly, I'm doing a few more tests on my end to confirm the obvious candidates haven't been impacted with this change (and will need to rebase against master to include @mreid-tt recent python fix to complete my testing). |
Description
This PR introduces:
nativebinaries are relocatable (specific to CMake)cross-cmake.mk: DisableCMAKE_BUILD_WITH_INSTALL_RPATHto avoid build-time executables to use the same RPATH as the cross-compiledbin|libsynocli-develdependencies targetting notably x25 platforms as package was never re-released.Changes
1. Prevent build environment leakage
Several build failures were traced back to toolchain and build variables leaking across dependency boundaries, especially when mixing different build systems (autotools, CMake or Meson builds).
In particular:
Variables such as
CC,CXX,CFLAGS,LDFLAGS,STRIP, etc. were implicitly exported even when they should not be. This is an historic behavior of spksrc as it used to only be supporting autotools and manual build types until I added CMake and meson much later on. This caused target-built binaries to be executed as native tools, leading to errors such as Exec format error (e.g.llvm-min-tblgenbeing built for the target instead of the host).Changes:
DEFAULT_ENVselector to control which build environment is initialized.This finally allows complex compilation such as
llvmto avoid usingCCandCXXcontent (as now inexistant in CMake) for compilingNATIVEin-build tools, and in turn avoid the need of keeping aroundnative/llvm-9.0for instance.Worth noting that some leakage might still occur when going through the dependencies as the code is still as follow:
Although impact should be minimal considering:
NATIVEin-build targetsThus chances of hiting such remaining occurence is extremely low but I'll consider reviewing this remaining logic into a subsequet PR when time allows it.
While this is a rather long description of what this change is about, there shouldn't be any changes noticed from a user experience with exception that:
$(WORK_DIR)/tc_var.mkstripis now resolved directly from the target toolchain when available, instead of relying on autotools environment variables. This avoids failures when autotools is not in use, while remaining compatible with build types.autotools_vars,tc_flagsandrust_vars) compilation:2. Fix runpath so
nativebinaries are relocatableFor native build use
-DCMAKE_INSTALL_RPATH='$$ORIGIN/../lib'which allows any binary to be relocatable. Otherwise without this fix we needed to setLD_LIBRARY_PATH=<path>in order for it to run properly.3.
cross-cmake.mk: DisableCMAKE_BUILD_WITH_INSTALL_RPATHThis causes the build-time executables to use the same RPATH as the cross-compiled
bin|libexpected to run in the destination installation path causing them to fail when executed as unable to find their relative native libraries they were built against.4.
synocli-develpackage updates:Checklist
all-supportedcompleted successfullyType of change
smallframework changes