Currently, trying to compile LLVM-BPF will fail with:
[2225/3517] Linking CXX shared library lib/libLLVM-15.so
FAILED: lib/libLLVM-15.so
/usr/bin/ld: staging_dir/host/lib/libzstd.a(zstd_common.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: failed to set dynamic section sizes: bad value
collect2: error: ld returned 1 exit status
So, to fix it enable PIC for the host ZSTD.
Fixes: #15247
Signed-off-by: Bryan Roessler <bryanroessler@gmail.com>
Proposed fixup has been replaced and merged with an advanced version.
install-pc-mt has been dropped and replaced for intall-pc MT=1 to
generate a .pc file with multithread libs.
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
Now that instead of relying on env variables for the GH download script
invoking ZSTD tarball compression it passes the full arguments via tar -I
we can drop the CLI max compression level override.
Signed-off-by: Robert Marko <robimarko@gmail.com>
The current .pc generated by make build system for zstd is wrong and
always assume a single-threaded library is used.
This wasn't the case for the meson build system that used his own logic
to generate the pkg-config file.
Add a patch to fix this by introducing install-mt-pc make target to
generate the correct pkg-config gile.
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
We forgot to make sure install-includes is called for the libzstd in
order for it to install the required headers.
Fixes: 4b920e799f ("tools: zstd: convert to make and drop meson dependency")
Signed-off-by: Robert Marko <robimarko@gmail.com>
We dont really have a reason to deviate from the upstream default for
ZSTD_LEGACY_SUPPORT value of 5, as it will save a bit of space but
prevent decompressing data compressed with legacy ZSTD versions.
Signed-off-by: Robert Marko <robimarko@gmail.com>
ZTSD limits the safe compression level to a max of 19 as 20 to 22 cause
increased RAM usage. Higher levels require --ultra arg passed.
There isn't currently a way to set --ultra using ENV options similar to
ZSTD_CLEVEL and ZSTD_CLEVEL is limited to 19.
To fix this, we can increase the max safe compression level by providing
a custom ZSTDCLI_CLEVEL_MAX value with CFLAGS.
The max safe level is increased to 20.
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
Convert to make and drop meson dependency since it's not a core tools
and can't depend on advanced build system like cmake or meson.
On top of this make is the official build support and cmake/meson are
supported by 3rd parties.
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
Switched to building with meson as it's faster and does not need a
dependency on cmake, which takes a long time to build.
Signed-off-by: Rosen Penev <rosenp@gmail.com>
Switched to building with meson as it's faster and does not need a
dependency on cmake, which takes a long time to build.
Signed-off-by: Rosen Penev <rosenp@gmail.com>
Switch to the normal tarball instead of the codeload generated one. The
latter has the potential to change hashes based on changes in the repo.
Signed-off-by: Rosen Penev <rosenp@gmail.com>
It looks like GitHub changed the URL path for release tarballs, thus the
download for the zstd package was always falling back to the OpenWrt
sources mirror.
Fix the GitHub URL for one which works. The file hash remains unchanged.
Signed-off-by: David Bauer <mail@david-bauer.net>
Upstream switched to building with CMake. Adjust accordingly.
Reapplied patch as upstream changed the file format.
Added HOST_BUILD_PARALLEL for faster compilation.
Added cmake tool dependency and removed circular dependencies as a
result.
Adjusted dependent tools to use NOCACHE as they are needed to build
ccache.
Signed-off-by: Rosen Penev <rosenp@gmail.com>