From 7b00cc679d5d8a33846a56c46fccbc72effabe47 Mon Sep 17 00:00:00 2001 From: alex-nitrokey Date: Wed, 10 Jun 2020 10:24:03 +0200 Subject: [PATCH 01/10] Upgrade cryptsetup to version 2.3.3 --- modules/cryptsetup | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/cryptsetup b/modules/cryptsetup index 4cea7f35..506eb730 100644 --- a/modules/cryptsetup +++ b/modules/cryptsetup @@ -2,11 +2,11 @@ modules-$(CONFIG_CRYPTSETUP) += cryptsetup cryptsetup_depends := util-linux popt lvm2 $(musl_dep) -cryptsetup_version := 1.7.3 +cryptsetup_version := 2.3.3 cryptsetup_dir := cryptsetup-$(cryptsetup_version) cryptsetup_tar := cryptsetup-$(cryptsetup_version).tar.xz -cryptsetup_url := https://www.kernel.org/pub/linux/utils/cryptsetup/v1.7/cryptsetup-$(cryptsetup_version).tar.xz -cryptsetup_hash := af2b04e8475cf40b8d9ffd97a1acfa73aa787c890430afd89804fb544d6adc02 +cryptsetup_url := https://www.kernel.org/pub/linux/utils/cryptsetup/v2.3/cryptsetup-$(cryptsetup_version).tar.xz +cryptsetup_hash := 3bca4ffe39e2f94cef50f6ea65acb873a6dbce5db34fc6bcefe38b6d095e82df # Use an empty prefix so that the executables will not include the # build path. From 7adcd4b3927eb780f917fe6e6dec6e474d374a83 Mon Sep 17 00:00:00 2001 From: alex-nitrokey Date: Wed, 10 Jun 2020 11:20:41 +0200 Subject: [PATCH 02/10] Add json-c as cryptsetup 2.3.3 dependency --- modules/cryptsetup | 24 +++++++++++++++++++++++- modules/json-c | 2 ++ 2 files changed, 25 insertions(+), 1 deletion(-) create mode 100644 modules/json-c diff --git a/modules/cryptsetup b/modules/cryptsetup index 506eb730..59c88dde 100644 --- a/modules/cryptsetup +++ b/modules/cryptsetup @@ -12,6 +12,8 @@ cryptsetup_hash := 3bca4ffe39e2f94cef50f6ea65acb873a6dbce5db34fc6bcefe38b6d095e8 # build path. cryptsetup_configure := ./configure \ $(CROSS_TOOLS) \ + JSON_C_LIBS="-l$(INSTALL)/lib/json-c" \ + JSON_C_CFLAGS="I$(INSTALL)/include/json-c" \ --host i386-elf-linux \ --prefix "/" \ --disable-gcrypt-pbkdf2 \ @@ -33,5 +35,25 @@ cryptsetup_output := \ src/.libs/veritysetup \ cryptsetup_libraries := \ - lib/.libs/libcryptsetup.so.4 \ + lib/.libs/libcryptsetup.so.12.6.0 \ + +# json-c is needed since cryptsetup version 2.0 +cryptsetup_depends += json-c +modules-y += json-c + +json-c_version := 0.14 +json-c_dir := json-c-$(json-c_version) +json-c_tar := json-c-$(json-c_version).tar.gz +json-c_url := https://s3.amazonaws.com/json-c_releases/releases/json-c-$(json-c_version)-nodoc.tar.gz +json-c_hash := 99914e644a25201d82ccefa20430f7515c110923360f9ef46755527c02412afa + +# there is a bug in cmake-configure so that it can not be used with a "=", fxed in next +# release though (then it needs to read '--prefix="$(INSTALL)"' here instead +json-c_configure := mkdir build && \ + cd build && \ + ../cmake-configure --prefix "$(INSTALL)" + +json-c_target := $(CROSS_TOOLS) -C $(build)/$(json-c_dir)/build all install + +json-c_libraries := build/libjson-c.so.5.0.0 diff --git a/modules/json-c b/modules/json-c new file mode 100644 index 00000000..751a1630 --- /dev/null +++ b/modules/json-c @@ -0,0 +1,2 @@ +# empty placeholder file +# This submodule is defined in modules/cryptsetup From f674a479972e26fa774ab2787aab110504e3170d Mon Sep 17 00:00:00 2001 From: alex-nitrokey Date: Wed, 10 Jun 2020 16:55:25 +0200 Subject: [PATCH 03/10] Add patch for cryptsetup 2.3.3 Following commit ed3602f0ba62ccdb806cda5a5a055bbc386c2185 (maintain reproducibility by removing rpath) and applying the same changes for new version of cryptsetup. --- patches/cryptsetup-2.3.3.patch | 527 +++++++++++++++++++++++++++++++++ 1 file changed, 527 insertions(+) create mode 100644 patches/cryptsetup-2.3.3.patch diff --git a/patches/cryptsetup-2.3.3.patch b/patches/cryptsetup-2.3.3.patch new file mode 100644 index 00000000..644d9a6c --- /dev/null +++ b/patches/cryptsetup-2.3.3.patch @@ -0,0 +1,527 @@ +diff -u -r cryptsetup-2.3.3-clean/configure cryptsetup-2.3.3/configure +--- cryptsetup-2.3.3-clean/configure 2020-06-10 14:05:45.784925972 +0200 ++++ cryptsetup-2.3.3/configure 2020-06-10 14:12:03.811651237 +0200 +@@ -10206,7 +10206,7 @@ + hardcode_automatic=no + hardcode_direct=no + hardcode_direct_absolute=no +- hardcode_libdir_flag_spec= ++ hardcode_libdir_flag_spec=" " + hardcode_libdir_separator= + hardcode_minus_L=no + hardcode_shlibpath_var=unsupported +@@ -10290,7 +10290,7 @@ + # are reset later if shared libraries are not supported. Putting them + # here allows them to be overridden if necessary. + runpath_var=LD_RUN_PATH +- hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' ++ hardcode_libdir_flag_spec=" " + export_dynamic_flag_spec='$wl--export-dynamic' + # ancient GNU ld didn't support --whole-archive et. al. + if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then +@@ -10336,7 +10336,7 @@ + ;; + m68k) + archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' +- hardcode_libdir_flag_spec='-L$libdir' ++ hardcode_libdir_flag_spec=" " + hardcode_minus_L=yes + ;; + esac +@@ -10356,7 +10356,7 @@ + cygwin* | mingw* | pw32* | cegcc*) + # _LT_TAGVAR(hardcode_libdir_flag_spec, ) is actually meaningless, + # as there is no search path for DLLs. +- hardcode_libdir_flag_spec='-L$libdir' ++ hardcode_libdir_flag_spec=" " + export_dynamic_flag_spec='$wl--export-all-symbols' + allow_undefined_flag=unsupported + always_export_symbols=no +@@ -10386,7 +10386,7 @@ + ;; + + os2*) +- hardcode_libdir_flag_spec='-L$libdir' ++ hardcode_libdir_flag_spec=" " + hardcode_minus_L=yes + allow_undefined_flag=unsupported + shrext_cmds=.dll +@@ -10416,7 +10416,7 @@ + interix[3-9]*) + hardcode_direct=no + hardcode_shlibpath_var=no +- hardcode_libdir_flag_spec='$wl-rpath,$libdir' ++ hardcode_libdir_flag_spec=" " + export_dynamic_flag_spec='$wl-E' + # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. + # Instead, shared libraries are loaded at an image base (0x10000000 by +@@ -10492,7 +10492,7 @@ + xlf* | bgf* | bgxlf* | mpixlf*) + # IBM XL Fortran 10.1 on PPC cannot create shared libs itself + whole_archive_flag_spec='--whole-archive$convenience --no-whole-archive' +- hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' ++ hardcode_libdir_flag_spec=" " + archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib' + if test yes = "$supports_anon_versioning"; then + archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~ +@@ -10559,7 +10559,7 @@ + # DT_RUNPATH tag from executables and libraries. But doing so + # requires that you compile everything twice, which is a pain. + if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then +- hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' ++ hardcode_libdir_flag_spec=" " + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' + archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' + else +@@ -10588,7 +10588,7 @@ + + if test no = "$ld_shlibs"; then + runpath_var= +- hardcode_libdir_flag_spec= ++ hardcode_libdir_flag_spec=" " + export_dynamic_flag_spec= + whole_archive_flag_spec= + fi +@@ -10706,7 +10706,7 @@ + # path is not listed in the libpath. Setting hardcode_minus_L + # to unsupported forces relinking + hardcode_minus_L=yes +- hardcode_libdir_flag_spec='-L$libdir' ++ hardcode_libdir_flag_spec=" " + hardcode_libdir_separator= + fi + ;; +@@ -10790,11 +10790,11 @@ + aix_libpath=$lt_cv_aix_libpath_ + fi + +- hardcode_libdir_flag_spec='$wl-blibpath:$libdir:'"$aix_libpath" ++ hardcode_libdir_flag_spec=" " + archive_expsym_cmds='$CC -o $output_objdir/$soname $libobjs $deplibs $wl'$no_entry_flag' $compiler_flags `if test -n "$allow_undefined_flag"; then func_echo_all "$wl$allow_undefined_flag"; else :; fi` $wl'$exp_sym_flag:\$export_symbols' '$shared_flag + else + if test ia64 = "$host_cpu"; then +- hardcode_libdir_flag_spec='$wl-R $libdir:/usr/lib:/lib' ++ hardcode_libdir_flag_spec=" " + allow_undefined_flag="-z nodefs" + archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\$wl$no_entry_flag"' $compiler_flags $wl$allow_undefined_flag '"\$wl$exp_sym_flag:\$export_symbols" + else +@@ -10843,7 +10843,7 @@ + aix_libpath=$lt_cv_aix_libpath_ + fi + +- hardcode_libdir_flag_spec='$wl-blibpath:$libdir:'"$aix_libpath" ++ hardcode_libdir_flag_spec=" " + # Warning - without using the other run time loading flags, + # -berok will link without error, but may produce a broken library. + no_undefined_flag=' $wl-bernotok' +@@ -10883,7 +10883,7 @@ + ;; + m68k) + archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' +- hardcode_libdir_flag_spec='-L$libdir' ++ hardcode_libdir_flag_spec=" " + hardcode_minus_L=yes + ;; + esac +@@ -10901,7 +10901,7 @@ + case $cc_basename in + cl*) + # Native MSVC +- hardcode_libdir_flag_spec=' ' ++ hardcode_libdir_flag_spec=" " + allow_undefined_flag=unsupported + always_export_symbols=yes + file_list_spec='@' +@@ -10942,7 +10942,7 @@ + ;; + *) + # Assume MSVC wrapper +- hardcode_libdir_flag_spec=' ' ++ hardcode_libdir_flag_spec=" " + allow_undefined_flag=unsupported + # Tell ltmain to make .lib files, not .a files. + libext=lib +@@ -10993,7 +10993,7 @@ + + dgux*) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' +- hardcode_libdir_flag_spec='-L$libdir' ++ hardcode_libdir_flag_spec=" " + hardcode_shlibpath_var=no + ;; + +@@ -11003,7 +11003,7 @@ + # extra space). + freebsd2.2*) + archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' +- hardcode_libdir_flag_spec='-R$libdir' ++ hardcode_libdir_flag_spec=" " + hardcode_direct=yes + hardcode_shlibpath_var=no + ;; +@@ -11019,7 +11019,7 @@ + # FreeBSD 3 and greater uses gcc -shared to do shared libraries. + freebsd* | dragonfly*) + archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' +- hardcode_libdir_flag_spec='-R$libdir' ++ hardcode_libdir_flag_spec=" " + hardcode_direct=yes + hardcode_shlibpath_var=no + ;; +@@ -11030,7 +11030,7 @@ + else + archive_cmds='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib' + fi +- hardcode_libdir_flag_spec='$wl+b $wl$libdir' ++ hardcode_libdir_flag_spec=" " + hardcode_libdir_separator=: + hardcode_direct=yes + +@@ -11047,7 +11047,7 @@ + archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' + fi + if test no = "$with_gnu_ld"; then +- hardcode_libdir_flag_spec='$wl+b $wl$libdir' ++ hardcode_libdir_flag_spec=" " + hardcode_libdir_separator=: + hardcode_direct=yes + hardcode_direct_absolute=yes +@@ -11124,7 +11124,7 @@ + esac + fi + if test no = "$with_gnu_ld"; then +- hardcode_libdir_flag_spec='$wl+b $wl$libdir' ++ hardcode_libdir_flag_spec=" " + hardcode_libdir_separator=: + + case $host_cpu in +@@ -11183,7 +11183,7 @@ + archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -exports_file $export_symbols -o $lib' + fi + archive_cmds_need_lc='no' +- hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' ++ hardcode_libdir_flag_spec=" " + hardcode_libdir_separator=: + inherit_rpath=yes + link_all_deplibs=yes +@@ -11205,7 +11205,7 @@ + else + archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF + fi +- hardcode_libdir_flag_spec='-R$libdir' ++ hardcode_libdir_flag_spec=" " + hardcode_direct=yes + hardcode_shlibpath_var=no + ;; +@@ -11213,7 +11213,7 @@ + newsos6) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct=yes +- hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' ++ hardcode_libdir_flag_spec=" " + hardcode_libdir_separator=: + hardcode_shlibpath_var=no + ;; +@@ -11229,11 +11229,11 @@ + if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then + archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags $wl-retain-symbols-file,$export_symbols' +- hardcode_libdir_flag_spec='$wl-rpath,$libdir' ++ hardcode_libdir_flag_spec=" " + export_dynamic_flag_spec='$wl-E' + else + archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' +- hardcode_libdir_flag_spec='$wl-rpath,$libdir' ++ hardcode_libdir_flag_spec=" " + fi + else + ld_shlibs=no +@@ -11241,7 +11241,7 @@ + ;; + + os2*) +- hardcode_libdir_flag_spec='-L$libdir' ++ hardcode_libdir_flag_spec=" " + hardcode_minus_L=yes + allow_undefined_flag=unsupported + shrext_cmds=.dll +@@ -11277,7 +11277,7 @@ + archive_cmds='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' + fi + archive_cmds_need_lc='no' +- hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' ++ hardcode_libdir_flag_spec=" " + hardcode_libdir_separator=: + ;; + +@@ -11285,7 +11285,7 @@ + if test yes = "$GCC"; then + allow_undefined_flag=' $wl-expect_unresolved $wl\*' + archive_cmds='$CC -shared$allow_undefined_flag $pic_flag $libobjs $deplibs $compiler_flags $wl-msym $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' +- hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' ++ hardcode_libdir_flag_spec=" " + else + allow_undefined_flag=' -expect_unresolved \*' + archive_cmds='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' +@@ -11293,7 +11293,7 @@ + $CC -shared$allow_undefined_flag $wl-input $wl$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib~$RM $lib.exp' + + # Both c and cxx compiler support -rpath directly +- hardcode_libdir_flag_spec='-rpath $libdir' ++ hardcode_libdir_flag_spec=" " + fi + archive_cmds_need_lc='no' + hardcode_libdir_separator=: +@@ -11322,7 +11322,7 @@ + ;; + esac + fi +- hardcode_libdir_flag_spec='-R$libdir' ++ hardcode_libdir_flag_spec=" " + hardcode_shlibpath_var=no + case $host_os in + solaris2.[0-5] | solaris2.[0-5].*) ;; +@@ -11349,7 +11349,7 @@ + else + archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' + fi +- hardcode_libdir_flag_spec='-L$libdir' ++ hardcode_libdir_flag_spec=" " + hardcode_direct=yes + hardcode_minus_L=yes + hardcode_shlibpath_var=no +@@ -11419,7 +11419,7 @@ + allow_undefined_flag='$wl-z,nodefs' + archive_cmds_need_lc=no + hardcode_shlibpath_var=no +- hardcode_libdir_flag_spec='$wl-R,$libdir' ++ hardcode_libdir_flag_spec=" " + hardcode_libdir_separator=':' + link_all_deplibs=yes + export_dynamic_flag_spec='$wl-Bexport' +@@ -11436,7 +11436,7 @@ + + uts4*) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' +- hardcode_libdir_flag_spec='-L$libdir' ++ hardcode_libdir_flag_spec=" " + hardcode_shlibpath_var=no + ;; + +@@ -11804,7 +11804,7 @@ + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no +- hardcode_into_libs=yes ++ hardcode_into_libs=no + if test ia64 = "$host_cpu"; then + # AIX 5 supports IA64 + library_names_spec='$libname$release$shared_ext$major $libname$release$shared_ext$versuffix $libname$shared_ext' +@@ -12094,16 +12094,16 @@ + ;; + freebsd3.[01]* | freebsdelf3.[01]*) + shlibpath_overrides_runpath=yes +- hardcode_into_libs=yes ++ hardcode_into_libs=no + ;; + freebsd3.[2-9]* | freebsdelf3.[2-9]* | \ + freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1) + shlibpath_overrides_runpath=no +- hardcode_into_libs=yes ++ hardcode_into_libs=no + ;; + *) # from 4.6 on, and DragonFly + shlibpath_overrides_runpath=yes +- hardcode_into_libs=yes ++ hardcode_into_libs=no + ;; + esac + ;; +@@ -12118,7 +12118,7 @@ + shlibpath_var=LIBRARY_PATH + shlibpath_overrides_runpath=no + sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib' +- hardcode_into_libs=yes ++ hardcode_into_libs=no + ;; + + hpux9* | hpux10* | hpux11*) +@@ -12130,7 +12130,7 @@ + case $host_cpu in + ia64*) + shrext_cmds='.so' +- hardcode_into_libs=yes ++ hardcode_into_libs=no + dynamic_linker="$host_os dld.so" + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. +@@ -12146,7 +12146,7 @@ + ;; + hppa*64*) + shrext_cmds='.sl' +- hardcode_into_libs=yes ++ hardcode_into_libs=no + dynamic_linker="$host_os dld.sl" + shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH + shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. +@@ -12179,7 +12179,7 @@ + dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no +- hardcode_into_libs=yes ++ hardcode_into_libs=no + ;; + + irix5* | irix6* | nonstopux*) +@@ -12216,7 +12216,7 @@ + shlibpath_overrides_runpath=no + sys_lib_search_path_spec="/usr/lib$libsuff /lib$libsuff /usr/local/lib$libsuff" + sys_lib_dlsearch_path_spec="/usr/lib$libsuff /lib$libsuff" +- hardcode_into_libs=yes ++ hardcode_into_libs=no + ;; + + # No shared lib support for Linux oldld, aout, or coff. +@@ -12237,11 +12237,11 @@ + # This implies no fast_install, which is unacceptable. + # Some rework will be needed to allow for fast_install + # before this can be enabled. +- hardcode_into_libs=yes ++ hardcode_into_libs=no + + dynamic_linker='Android linker' + # Don't embed -rpath directories since the linker doesn't support them. +- hardcode_libdir_flag_spec='-L$libdir' ++ hardcode_libdir_flag_spec=" " + ;; + + # This must be glibc/ELF. +@@ -12292,7 +12292,7 @@ + # This implies no fast_install, which is unacceptable. + # Some rework will be needed to allow for fast_install + # before this can be enabled. +- hardcode_into_libs=yes ++ hardcode_into_libs=no + + # Ideally, we could use ldconfig to report *all* directores which are + # searched for libraries, however this is still not possible. Aside from not +@@ -12322,7 +12322,7 @@ + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no +- hardcode_into_libs=yes ++ hardcode_into_libs=no + dynamic_linker='NetBSD ld.elf_so' + ;; + +@@ -12341,7 +12341,7 @@ + fi + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes +- hardcode_into_libs=yes ++ hardcode_into_libs=no + ;; + + newsos6) +@@ -12359,7 +12359,7 @@ + soname_spec='$libname$release$shared_ext$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no +- hardcode_into_libs=yes ++ hardcode_into_libs=no + dynamic_linker='ldqnx.so' + ;; + +@@ -12431,7 +12431,7 @@ + soname_spec='$libname$release$shared_ext$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes +- hardcode_into_libs=yes ++ hardcode_into_libs=no + # ldd complains unless libraries are executable + postinstall_cmds='chmod +x $lib' + ;; +@@ -12488,7 +12488,7 @@ + soname_spec='$libname$release$shared_ext$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes +- hardcode_into_libs=yes ++ hardcode_into_libs=no + if test yes = "$with_gnu_ld"; then + sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' + else +@@ -12510,7 +12510,7 @@ + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no +- hardcode_into_libs=yes ++ hardcode_into_libs=no + ;; + + uts4*) +@@ -13610,7 +13610,7 @@ + acl_shlibext="$acl_cv_shlibext" + acl_libname_spec="$acl_cv_libname_spec" + acl_library_names_spec="$acl_cv_library_names_spec" +- acl_hardcode_libdir_flag_spec="$acl_cv_hardcode_libdir_flag_spec" ++ acl_hardcode_libdir_flag_spec=" " + acl_hardcode_libdir_separator="$acl_cv_hardcode_libdir_separator" + acl_hardcode_direct="$acl_cv_hardcode_direct" + acl_hardcode_minus_L="$acl_cv_hardcode_minus_L" +@@ -21296,7 +21296,7 @@ + with_gnu_ld='`$ECHO "$with_gnu_ld" | $SED "$delay_single_quote_subst"`' + allow_undefined_flag='`$ECHO "$allow_undefined_flag" | $SED "$delay_single_quote_subst"`' + no_undefined_flag='`$ECHO "$no_undefined_flag" | $SED "$delay_single_quote_subst"`' +-hardcode_libdir_flag_spec='`$ECHO "$hardcode_libdir_flag_spec" | $SED "$delay_single_quote_subst"`' ++hardcode_libdir_flag_spec=" " + hardcode_libdir_separator='`$ECHO "$hardcode_libdir_separator" | $SED "$delay_single_quote_subst"`' + hardcode_direct='`$ECHO "$hardcode_direct" | $SED "$delay_single_quote_subst"`' + hardcode_direct_absolute='`$ECHO "$hardcode_direct_absolute" | $SED "$delay_single_quote_subst"`' +@@ -21327,7 +21327,7 @@ + postuninstall_cmds='`$ECHO "$postuninstall_cmds" | $SED "$delay_single_quote_subst"`' + finish_cmds='`$ECHO "$finish_cmds" | $SED "$delay_single_quote_subst"`' + finish_eval='`$ECHO "$finish_eval" | $SED "$delay_single_quote_subst"`' +-hardcode_into_libs='`$ECHO "$hardcode_into_libs" | $SED "$delay_single_quote_subst"`' ++hardcode_into_libs=no + sys_lib_search_path_spec='`$ECHO "$sys_lib_search_path_spec" | $SED "$delay_single_quote_subst"`' + configure_time_dlsearch_path='`$ECHO "$configure_time_dlsearch_path" | $SED "$delay_single_quote_subst"`' + configure_time_lt_sys_library_path='`$ECHO "$configure_time_lt_sys_library_path" | $SED "$delay_single_quote_subst"`' +@@ -22485,7 +22485,7 @@ + finish_eval=$lt_finish_eval + + # Whether we should hardcode library paths into libraries. +-hardcode_into_libs=$hardcode_into_libs ++hardcode_into_libs=no + + # Compile-time system search path for libraries. + sys_lib_search_path_spec=$lt_sys_lib_search_path_spec +@@ -22582,7 +22582,7 @@ + + # Flag to hardcode \$libdir into a binary during linking. + # This must work even if \$libdir does not exist +-hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec ++hardcode_libdir_flag_spec=" " + + # Whether we need a single "-rpath" flag with a separated argument. + hardcode_libdir_separator=$lt_hardcode_libdir_separator +diff -u -r cryptsetup-2.3.3-clean/Makefile.in cryptsetup-2.3.3/Makefile.in +--- cryptsetup-2.3.3-clean/Makefile.in 2020-06-10 14:05:45.781594282 +0200 ++++ cryptsetup-2.3.3/Makefile.in 2020-06-10 14:30:09.512375745 +0200 +@@ -1032,6 +1032,8 @@ + @CRYPTSETUP_TRUE@cryptsetup_LDADD = $(LDADD) \ + @CRYPTSETUP_TRUE@ libcryptsetup.la \ + @CRYPTSETUP_TRUE@ @POPT_LIBS@ \ ++@CRYPTSETUP_TRUE@ @UUID_LIBS@ \ ++@CRYPTSETUP_TRUE@ @DEVMAPPER_LIBS@ \ + @CRYPTSETUP_TRUE@ @PWQUALITY_LIBS@ \ + @CRYPTSETUP_TRUE@ @PASSWDQC_LIBS@ \ + @CRYPTSETUP_TRUE@ @UUID_LIBS@ \ +@@ -1060,6 +1062,8 @@ + @VERITYSETUP_TRUE@veritysetup_LDADD = $(LDADD) \ + @VERITYSETUP_TRUE@ libcryptsetup.la \ + @VERITYSETUP_TRUE@ @POPT_LIBS@ \ ++@VERITYSETUP_TRUE@ @UUID_LIBS@ \ ++@VERITYSETUP_TRUE@ @DEVMAPPER_LIBS@ \ + @VERITYSETUP_TRUE@ @PWQUALITY_LIBS@ \ + @VERITYSETUP_TRUE@ @PASSWDQC_LIBS@ \ + @VERITYSETUP_TRUE@ @BLKID_LIBS@ From 1ef8d14921f9fb60bd8d1c2f96b25b8805870f78 Mon Sep 17 00:00:00 2001 From: alex-nitrokey Date: Wed, 10 Jun 2020 17:05:01 +0200 Subject: [PATCH 04/10] Use configure parameter instead of patchfile for rpath * hardcode rpatch patch not needed as `--disable-rpath` is available * remove obsolete config parameters --- modules/cryptsetup | 5 +- patches/cryptsetup-1.7.3.patch | 527 --------------------------------- patches/cryptsetup-2.3.3.patch | 525 +------------------------------- 3 files changed, 15 insertions(+), 1042 deletions(-) delete mode 100644 patches/cryptsetup-1.7.3.patch diff --git a/modules/cryptsetup b/modules/cryptsetup index 59c88dde..8ed526ef 100644 --- a/modules/cryptsetup +++ b/modules/cryptsetup @@ -12,12 +12,9 @@ cryptsetup_hash := 3bca4ffe39e2f94cef50f6ea65acb873a6dbce5db34fc6bcefe38b6d095e8 # build path. cryptsetup_configure := ./configure \ $(CROSS_TOOLS) \ - JSON_C_LIBS="-l$(INSTALL)/lib/json-c" \ - JSON_C_CFLAGS="I$(INSTALL)/include/json-c" \ --host i386-elf-linux \ --prefix "/" \ - --disable-gcrypt-pbkdf2 \ - --enable-cryptsetup-reencrypt \ + --disable-rpath \ --with-crypto_backend=kernel \ # but after building, replace prefix so that they will be installed diff --git a/patches/cryptsetup-1.7.3.patch b/patches/cryptsetup-1.7.3.patch deleted file mode 100644 index be7350d8..00000000 --- a/patches/cryptsetup-1.7.3.patch +++ /dev/null @@ -1,527 +0,0 @@ -diff -u -r cryptsetup-1.7.3-clean/configure cryptsetup-1.7.3/configure ---- cryptsetup-1.7.3-clean/configure 2016-10-28 06:45:06.000000000 -0700 -+++ cryptsetup-1.7.3/configure 2020-01-12 14:12:13.835035728 -0800 -@@ -10113,7 +10113,7 @@ - hardcode_automatic=no - hardcode_direct=no - hardcode_direct_absolute=no -- hardcode_libdir_flag_spec= -+ hardcode_libdir_flag_spec=" " - hardcode_libdir_separator= - hardcode_minus_L=no - hardcode_shlibpath_var=unsupported -@@ -10197,7 +10197,7 @@ - # are reset later if shared libraries are not supported. Putting them - # here allows them to be overridden if necessary. - runpath_var=LD_RUN_PATH -- hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' -+ hardcode_libdir_flag_spec=" " - export_dynamic_flag_spec='$wl--export-dynamic' - # ancient GNU ld didn't support --whole-archive et. al. - if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then -@@ -10243,7 +10243,7 @@ - ;; - m68k) - archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' -- hardcode_libdir_flag_spec='-L$libdir' -+ hardcode_libdir_flag_spec=" " - hardcode_minus_L=yes - ;; - esac -@@ -10263,7 +10263,7 @@ - cygwin* | mingw* | pw32* | cegcc*) - # _LT_TAGVAR(hardcode_libdir_flag_spec, ) is actually meaningless, - # as there is no search path for DLLs. -- hardcode_libdir_flag_spec='-L$libdir' -+ hardcode_libdir_flag_spec=" " - export_dynamic_flag_spec='$wl--export-all-symbols' - allow_undefined_flag=unsupported - always_export_symbols=no -@@ -10293,7 +10293,7 @@ - ;; - - os2*) -- hardcode_libdir_flag_spec='-L$libdir' -+ hardcode_libdir_flag_spec=" " - hardcode_minus_L=yes - allow_undefined_flag=unsupported - shrext_cmds=.dll -@@ -10323,7 +10323,7 @@ - interix[3-9]*) - hardcode_direct=no - hardcode_shlibpath_var=no -- hardcode_libdir_flag_spec='$wl-rpath,$libdir' -+ hardcode_libdir_flag_spec=" " - export_dynamic_flag_spec='$wl-E' - # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. - # Instead, shared libraries are loaded at an image base (0x10000000 by -@@ -10399,7 +10399,7 @@ - xlf* | bgf* | bgxlf* | mpixlf*) - # IBM XL Fortran 10.1 on PPC cannot create shared libs itself - whole_archive_flag_spec='--whole-archive$convenience --no-whole-archive' -- hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' -+ hardcode_libdir_flag_spec=" " - archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib' - if test yes = "$supports_anon_versioning"; then - archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~ -@@ -10466,7 +10466,7 @@ - # DT_RUNPATH tag from executables and libraries. But doing so - # requires that you compile everything twice, which is a pain. - if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then -- hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' -+ hardcode_libdir_flag_spec=" " - archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' - archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' - else -@@ -10495,7 +10495,7 @@ - - if test no = "$ld_shlibs"; then - runpath_var= -- hardcode_libdir_flag_spec= -+ hardcode_libdir_flag_spec=" " - export_dynamic_flag_spec= - whole_archive_flag_spec= - fi -@@ -10613,7 +10613,7 @@ - # path is not listed in the libpath. Setting hardcode_minus_L - # to unsupported forces relinking - hardcode_minus_L=yes -- hardcode_libdir_flag_spec='-L$libdir' -+ hardcode_libdir_flag_spec=" " - hardcode_libdir_separator= - fi - ;; -@@ -10697,11 +10697,11 @@ - aix_libpath=$lt_cv_aix_libpath_ - fi - -- hardcode_libdir_flag_spec='$wl-blibpath:$libdir:'"$aix_libpath" -+ hardcode_libdir_flag_spec=" " - archive_expsym_cmds='$CC -o $output_objdir/$soname $libobjs $deplibs $wl'$no_entry_flag' $compiler_flags `if test -n "$allow_undefined_flag"; then func_echo_all "$wl$allow_undefined_flag"; else :; fi` $wl'$exp_sym_flag:\$export_symbols' '$shared_flag - else - if test ia64 = "$host_cpu"; then -- hardcode_libdir_flag_spec='$wl-R $libdir:/usr/lib:/lib' -+ hardcode_libdir_flag_spec=" " - allow_undefined_flag="-z nodefs" - archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\$wl$no_entry_flag"' $compiler_flags $wl$allow_undefined_flag '"\$wl$exp_sym_flag:\$export_symbols" - else -@@ -10750,7 +10750,7 @@ - aix_libpath=$lt_cv_aix_libpath_ - fi - -- hardcode_libdir_flag_spec='$wl-blibpath:$libdir:'"$aix_libpath" -+ hardcode_libdir_flag_spec=" " - # Warning - without using the other run time loading flags, - # -berok will link without error, but may produce a broken library. - no_undefined_flag=' $wl-bernotok' -@@ -10790,7 +10790,7 @@ - ;; - m68k) - archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' -- hardcode_libdir_flag_spec='-L$libdir' -+ hardcode_libdir_flag_spec=" " - hardcode_minus_L=yes - ;; - esac -@@ -10808,7 +10808,7 @@ - case $cc_basename in - cl*) - # Native MSVC -- hardcode_libdir_flag_spec=' ' -+ hardcode_libdir_flag_spec=" " - allow_undefined_flag=unsupported - always_export_symbols=yes - file_list_spec='@' -@@ -10849,7 +10849,7 @@ - ;; - *) - # Assume MSVC wrapper -- hardcode_libdir_flag_spec=' ' -+ hardcode_libdir_flag_spec=" " - allow_undefined_flag=unsupported - # Tell ltmain to make .lib files, not .a files. - libext=lib -@@ -10900,7 +10900,7 @@ - - dgux*) - archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' -- hardcode_libdir_flag_spec='-L$libdir' -+ hardcode_libdir_flag_spec=" " - hardcode_shlibpath_var=no - ;; - -@@ -10910,7 +10910,7 @@ - # extra space). - freebsd2.2*) - archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' -- hardcode_libdir_flag_spec='-R$libdir' -+ hardcode_libdir_flag_spec=" " - hardcode_direct=yes - hardcode_shlibpath_var=no - ;; -@@ -10926,7 +10926,7 @@ - # FreeBSD 3 and greater uses gcc -shared to do shared libraries. - freebsd* | dragonfly*) - archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' -- hardcode_libdir_flag_spec='-R$libdir' -+ hardcode_libdir_flag_spec=" " - hardcode_direct=yes - hardcode_shlibpath_var=no - ;; -@@ -10937,7 +10937,7 @@ - else - archive_cmds='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib' - fi -- hardcode_libdir_flag_spec='$wl+b $wl$libdir' -+ hardcode_libdir_flag_spec=" " - hardcode_libdir_separator=: - hardcode_direct=yes - -@@ -10954,7 +10954,7 @@ - archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' - fi - if test no = "$with_gnu_ld"; then -- hardcode_libdir_flag_spec='$wl+b $wl$libdir' -+ hardcode_libdir_flag_spec=" " - hardcode_libdir_separator=: - hardcode_direct=yes - hardcode_direct_absolute=yes -@@ -11031,7 +11031,7 @@ - esac - fi - if test no = "$with_gnu_ld"; then -- hardcode_libdir_flag_spec='$wl+b $wl$libdir' -+ hardcode_libdir_flag_spec=" " - hardcode_libdir_separator=: - - case $host_cpu in -@@ -11090,7 +11090,7 @@ - archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -exports_file $export_symbols -o $lib' - fi - archive_cmds_need_lc='no' -- hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' -+ hardcode_libdir_flag_spec=" " - hardcode_libdir_separator=: - inherit_rpath=yes - link_all_deplibs=yes -@@ -11112,7 +11112,7 @@ - else - archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF - fi -- hardcode_libdir_flag_spec='-R$libdir' -+ hardcode_libdir_flag_spec=" " - hardcode_direct=yes - hardcode_shlibpath_var=no - ;; -@@ -11120,7 +11120,7 @@ - newsos6) - archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_direct=yes -- hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' -+ hardcode_libdir_flag_spec=" " - hardcode_libdir_separator=: - hardcode_shlibpath_var=no - ;; -@@ -11136,11 +11136,11 @@ - if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then - archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags $wl-retain-symbols-file,$export_symbols' -- hardcode_libdir_flag_spec='$wl-rpath,$libdir' -+ hardcode_libdir_flag_spec=" " - export_dynamic_flag_spec='$wl-E' - else - archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' -- hardcode_libdir_flag_spec='$wl-rpath,$libdir' -+ hardcode_libdir_flag_spec=" " - fi - else - ld_shlibs=no -@@ -11148,7 +11148,7 @@ - ;; - - os2*) -- hardcode_libdir_flag_spec='-L$libdir' -+ hardcode_libdir_flag_spec=" " - hardcode_minus_L=yes - allow_undefined_flag=unsupported - shrext_cmds=.dll -@@ -11184,7 +11184,7 @@ - archive_cmds='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' - fi - archive_cmds_need_lc='no' -- hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' -+ hardcode_libdir_flag_spec=" " - hardcode_libdir_separator=: - ;; - -@@ -11192,7 +11192,7 @@ - if test yes = "$GCC"; then - allow_undefined_flag=' $wl-expect_unresolved $wl\*' - archive_cmds='$CC -shared$allow_undefined_flag $pic_flag $libobjs $deplibs $compiler_flags $wl-msym $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' -- hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' -+ hardcode_libdir_flag_spec=" " - else - allow_undefined_flag=' -expect_unresolved \*' - archive_cmds='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' -@@ -11200,7 +11200,7 @@ - $CC -shared$allow_undefined_flag $wl-input $wl$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib~$RM $lib.exp' - - # Both c and cxx compiler support -rpath directly -- hardcode_libdir_flag_spec='-rpath $libdir' -+ hardcode_libdir_flag_spec=" " - fi - archive_cmds_need_lc='no' - hardcode_libdir_separator=: -@@ -11229,7 +11229,7 @@ - ;; - esac - fi -- hardcode_libdir_flag_spec='-R$libdir' -+ hardcode_libdir_flag_spec=" " - hardcode_shlibpath_var=no - case $host_os in - solaris2.[0-5] | solaris2.[0-5].*) ;; -@@ -11256,7 +11256,7 @@ - else - archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' - fi -- hardcode_libdir_flag_spec='-L$libdir' -+ hardcode_libdir_flag_spec=" " - hardcode_direct=yes - hardcode_minus_L=yes - hardcode_shlibpath_var=no -@@ -11326,7 +11326,7 @@ - allow_undefined_flag='$wl-z,nodefs' - archive_cmds_need_lc=no - hardcode_shlibpath_var=no -- hardcode_libdir_flag_spec='$wl-R,$libdir' -+ hardcode_libdir_flag_spec=" " - hardcode_libdir_separator=':' - link_all_deplibs=yes - export_dynamic_flag_spec='$wl-Bexport' -@@ -11343,7 +11343,7 @@ - - uts4*) - archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' -- hardcode_libdir_flag_spec='-L$libdir' -+ hardcode_libdir_flag_spec=" " - hardcode_shlibpath_var=no - ;; - -@@ -11711,7 +11711,7 @@ - version_type=linux # correct to gnu/linux during the next big refactor - need_lib_prefix=no - need_version=no -- hardcode_into_libs=yes -+ hardcode_into_libs=no - if test ia64 = "$host_cpu"; then - # AIX 5 supports IA64 - library_names_spec='$libname$release$shared_ext$major $libname$release$shared_ext$versuffix $libname$shared_ext' -@@ -12001,16 +12001,16 @@ - ;; - freebsd3.[01]* | freebsdelf3.[01]*) - shlibpath_overrides_runpath=yes -- hardcode_into_libs=yes -+ hardcode_into_libs=no - ;; - freebsd3.[2-9]* | freebsdelf3.[2-9]* | \ - freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1) - shlibpath_overrides_runpath=no -- hardcode_into_libs=yes -+ hardcode_into_libs=no - ;; - *) # from 4.6 on, and DragonFly - shlibpath_overrides_runpath=yes -- hardcode_into_libs=yes -+ hardcode_into_libs=no - ;; - esac - ;; -@@ -12025,7 +12025,7 @@ - shlibpath_var=LIBRARY_PATH - shlibpath_overrides_runpath=no - sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib' -- hardcode_into_libs=yes -+ hardcode_into_libs=no - ;; - - hpux9* | hpux10* | hpux11*) -@@ -12037,7 +12037,7 @@ - case $host_cpu in - ia64*) - shrext_cmds='.so' -- hardcode_into_libs=yes -+ hardcode_into_libs=no - dynamic_linker="$host_os dld.so" - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. -@@ -12053,7 +12053,7 @@ - ;; - hppa*64*) - shrext_cmds='.sl' -- hardcode_into_libs=yes -+ hardcode_into_libs=no - dynamic_linker="$host_os dld.sl" - shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH - shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. -@@ -12086,7 +12086,7 @@ - dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no -- hardcode_into_libs=yes -+ hardcode_into_libs=no - ;; - - irix5* | irix6* | nonstopux*) -@@ -12123,7 +12123,7 @@ - shlibpath_overrides_runpath=no - sys_lib_search_path_spec="/usr/lib$libsuff /lib$libsuff /usr/local/lib$libsuff" - sys_lib_dlsearch_path_spec="/usr/lib$libsuff /lib$libsuff" -- hardcode_into_libs=yes -+ hardcode_into_libs=no - ;; - - # No shared lib support for Linux oldld, aout, or coff. -@@ -12144,11 +12144,11 @@ - # This implies no fast_install, which is unacceptable. - # Some rework will be needed to allow for fast_install - # before this can be enabled. -- hardcode_into_libs=yes -+ hardcode_into_libs=no - - dynamic_linker='Android linker' - # Don't embed -rpath directories since the linker doesn't support them. -- hardcode_libdir_flag_spec='-L$libdir' -+ hardcode_libdir_flag_spec=" " - ;; - - # This must be glibc/ELF. -@@ -12199,7 +12199,7 @@ - # This implies no fast_install, which is unacceptable. - # Some rework will be needed to allow for fast_install - # before this can be enabled. -- hardcode_into_libs=yes -+ hardcode_into_libs=no - - # Ideally, we could use ldconfig to report *all* directores which are - # searched for libraries, however this is still not possible. Aside from not -@@ -12229,7 +12229,7 @@ - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no -- hardcode_into_libs=yes -+ hardcode_into_libs=no - dynamic_linker='NetBSD ld.elf_so' - ;; - -@@ -12248,7 +12248,7 @@ - fi - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes -- hardcode_into_libs=yes -+ hardcode_into_libs=no - ;; - - newsos6) -@@ -12266,7 +12266,7 @@ - soname_spec='$libname$release$shared_ext$major' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no -- hardcode_into_libs=yes -+ hardcode_into_libs=no - dynamic_linker='ldqnx.so' - ;; - -@@ -12338,7 +12338,7 @@ - soname_spec='$libname$release$shared_ext$major' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes -- hardcode_into_libs=yes -+ hardcode_into_libs=no - # ldd complains unless libraries are executable - postinstall_cmds='chmod +x $lib' - ;; -@@ -12395,7 +12395,7 @@ - soname_spec='$libname$release$shared_ext$major' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes -- hardcode_into_libs=yes -+ hardcode_into_libs=no - if test yes = "$with_gnu_ld"; then - sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' - else -@@ -12417,7 +12417,7 @@ - library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no -- hardcode_into_libs=yes -+ hardcode_into_libs=no - ;; - - uts4*) -@@ -14964,7 +14964,7 @@ - wl="$acl_cv_wl" - libext="$acl_cv_libext" - shlibext="$acl_cv_shlibext" -- hardcode_libdir_flag_spec="$acl_cv_hardcode_libdir_flag_spec" -+ hardcode_libdir_flag_spec=" " - hardcode_libdir_separator="$acl_cv_hardcode_libdir_separator" - hardcode_direct="$acl_cv_hardcode_direct" - hardcode_minus_L="$acl_cv_hardcode_minus_L" -@@ -19683,7 +19683,7 @@ - with_gnu_ld='`$ECHO "$with_gnu_ld" | $SED "$delay_single_quote_subst"`' - allow_undefined_flag='`$ECHO "$allow_undefined_flag" | $SED "$delay_single_quote_subst"`' - no_undefined_flag='`$ECHO "$no_undefined_flag" | $SED "$delay_single_quote_subst"`' --hardcode_libdir_flag_spec='`$ECHO "$hardcode_libdir_flag_spec" | $SED "$delay_single_quote_subst"`' -+hardcode_libdir_flag_spec=" " - hardcode_libdir_separator='`$ECHO "$hardcode_libdir_separator" | $SED "$delay_single_quote_subst"`' - hardcode_direct='`$ECHO "$hardcode_direct" | $SED "$delay_single_quote_subst"`' - hardcode_direct_absolute='`$ECHO "$hardcode_direct_absolute" | $SED "$delay_single_quote_subst"`' -@@ -19714,7 +19714,7 @@ - postuninstall_cmds='`$ECHO "$postuninstall_cmds" | $SED "$delay_single_quote_subst"`' - finish_cmds='`$ECHO "$finish_cmds" | $SED "$delay_single_quote_subst"`' - finish_eval='`$ECHO "$finish_eval" | $SED "$delay_single_quote_subst"`' --hardcode_into_libs='`$ECHO "$hardcode_into_libs" | $SED "$delay_single_quote_subst"`' -+hardcode_into_libs=no - sys_lib_search_path_spec='`$ECHO "$sys_lib_search_path_spec" | $SED "$delay_single_quote_subst"`' - configure_time_dlsearch_path='`$ECHO "$configure_time_dlsearch_path" | $SED "$delay_single_quote_subst"`' - configure_time_lt_sys_library_path='`$ECHO "$configure_time_lt_sys_library_path" | $SED "$delay_single_quote_subst"`' -@@ -20877,7 +20877,7 @@ - finish_eval=$lt_finish_eval - - # Whether we should hardcode library paths into libraries. --hardcode_into_libs=$hardcode_into_libs -+hardcode_into_libs=no - - # Compile-time system search path for libraries. - sys_lib_search_path_spec=$lt_sys_lib_search_path_spec -@@ -20974,7 +20974,7 @@ - - # Flag to hardcode \$libdir into a binary during linking. - # This must work even if \$libdir does not exist --hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec -+hardcode_libdir_flag_spec=" " - - # Whether we need a single "-rpath" flag with a separated argument. - hardcode_libdir_separator=$lt_hardcode_libdir_separator -diff -u -r cryptsetup-1.7.3-clean/src/Makefile.in cryptsetup-1.7.3/src/Makefile.in ---- cryptsetup-1.7.3-clean/src/Makefile.in 2016-10-28 06:45:06.000000000 -0700 -+++ cryptsetup-1.7.3/src/Makefile.in 2020-01-12 13:42:22.744734385 -0800 -@@ -479,6 +479,8 @@ - cryptsetup_LDADD = \ - $(top_builddir)/lib/libcryptsetup.la \ - @POPT_LIBS@ \ -+ @UUID_LIBS@ \ -+ @DEVMAPPER_LIBS@ \ - @PWQUALITY_LIBS@ \ - @PASSWDQC_LIBS@ - -@@ -503,6 +505,8 @@ - - @VERITYSETUP_TRUE@veritysetup_LDADD = \ - @VERITYSETUP_TRUE@ $(top_builddir)/lib/libcryptsetup.la \ -+@VERITYSETUP_TRUE@ @UUID_LIBS@ \ -+@VERITYSETUP_TRUE@ @DEVMAPPER_LIBS@ \ - @VERITYSETUP_TRUE@ @POPT_LIBS@ - - @VERITYSETUP_TRUE@veritysetup_CFLAGS = $(cryptsetup_CFLAGS) diff --git a/patches/cryptsetup-2.3.3.patch b/patches/cryptsetup-2.3.3.patch index 644d9a6c..22f8d34d 100644 --- a/patches/cryptsetup-2.3.3.patch +++ b/patches/cryptsetup-2.3.3.patch @@ -1,527 +1,30 @@ -diff -u -r cryptsetup-2.3.3-clean/configure cryptsetup-2.3.3/configure ---- cryptsetup-2.3.3-clean/configure 2020-06-10 14:05:45.784925972 +0200 -+++ cryptsetup-2.3.3/configure 2020-06-10 14:12:03.811651237 +0200 -@@ -10206,7 +10206,7 @@ - hardcode_automatic=no - hardcode_direct=no - hardcode_direct_absolute=no -- hardcode_libdir_flag_spec= -+ hardcode_libdir_flag_spec=" " - hardcode_libdir_separator= - hardcode_minus_L=no - hardcode_shlibpath_var=unsupported -@@ -10290,7 +10290,7 @@ - # are reset later if shared libraries are not supported. Putting them - # here allows them to be overridden if necessary. - runpath_var=LD_RUN_PATH -- hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' -+ hardcode_libdir_flag_spec=" " - export_dynamic_flag_spec='$wl--export-dynamic' - # ancient GNU ld didn't support --whole-archive et. al. - if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then -@@ -10336,7 +10336,7 @@ - ;; - m68k) - archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' -- hardcode_libdir_flag_spec='-L$libdir' -+ hardcode_libdir_flag_spec=" " - hardcode_minus_L=yes - ;; - esac -@@ -10356,7 +10356,7 @@ - cygwin* | mingw* | pw32* | cegcc*) - # _LT_TAGVAR(hardcode_libdir_flag_spec, ) is actually meaningless, - # as there is no search path for DLLs. -- hardcode_libdir_flag_spec='-L$libdir' -+ hardcode_libdir_flag_spec=" " - export_dynamic_flag_spec='$wl--export-all-symbols' - allow_undefined_flag=unsupported - always_export_symbols=no -@@ -10386,7 +10386,7 @@ - ;; - - os2*) -- hardcode_libdir_flag_spec='-L$libdir' -+ hardcode_libdir_flag_spec=" " - hardcode_minus_L=yes - allow_undefined_flag=unsupported - shrext_cmds=.dll -@@ -10416,7 +10416,7 @@ - interix[3-9]*) - hardcode_direct=no - hardcode_shlibpath_var=no -- hardcode_libdir_flag_spec='$wl-rpath,$libdir' -+ hardcode_libdir_flag_spec=" " - export_dynamic_flag_spec='$wl-E' - # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. - # Instead, shared libraries are loaded at an image base (0x10000000 by -@@ -10492,7 +10492,7 @@ - xlf* | bgf* | bgxlf* | mpixlf*) - # IBM XL Fortran 10.1 on PPC cannot create shared libs itself - whole_archive_flag_spec='--whole-archive$convenience --no-whole-archive' -- hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' -+ hardcode_libdir_flag_spec=" " - archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib' - if test yes = "$supports_anon_versioning"; then - archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~ -@@ -10559,7 +10559,7 @@ - # DT_RUNPATH tag from executables and libraries. But doing so - # requires that you compile everything twice, which is a pain. - if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then -- hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' -+ hardcode_libdir_flag_spec=" " - archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' - archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' - else -@@ -10588,7 +10588,7 @@ - - if test no = "$ld_shlibs"; then - runpath_var= -- hardcode_libdir_flag_spec= -+ hardcode_libdir_flag_spec=" " - export_dynamic_flag_spec= - whole_archive_flag_spec= - fi -@@ -10706,7 +10706,7 @@ - # path is not listed in the libpath. Setting hardcode_minus_L - # to unsupported forces relinking - hardcode_minus_L=yes -- hardcode_libdir_flag_spec='-L$libdir' -+ hardcode_libdir_flag_spec=" " - hardcode_libdir_separator= - fi - ;; -@@ -10790,11 +10790,11 @@ - aix_libpath=$lt_cv_aix_libpath_ - fi - -- hardcode_libdir_flag_spec='$wl-blibpath:$libdir:'"$aix_libpath" -+ hardcode_libdir_flag_spec=" " - archive_expsym_cmds='$CC -o $output_objdir/$soname $libobjs $deplibs $wl'$no_entry_flag' $compiler_flags `if test -n "$allow_undefined_flag"; then func_echo_all "$wl$allow_undefined_flag"; else :; fi` $wl'$exp_sym_flag:\$export_symbols' '$shared_flag - else - if test ia64 = "$host_cpu"; then -- hardcode_libdir_flag_spec='$wl-R $libdir:/usr/lib:/lib' -+ hardcode_libdir_flag_spec=" " - allow_undefined_flag="-z nodefs" - archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\$wl$no_entry_flag"' $compiler_flags $wl$allow_undefined_flag '"\$wl$exp_sym_flag:\$export_symbols" - else -@@ -10843,7 +10843,7 @@ - aix_libpath=$lt_cv_aix_libpath_ - fi - -- hardcode_libdir_flag_spec='$wl-blibpath:$libdir:'"$aix_libpath" -+ hardcode_libdir_flag_spec=" " - # Warning - without using the other run time loading flags, - # -berok will link without error, but may produce a broken library. - no_undefined_flag=' $wl-bernotok' -@@ -10883,7 +10883,7 @@ - ;; - m68k) - archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' -- hardcode_libdir_flag_spec='-L$libdir' -+ hardcode_libdir_flag_spec=" " - hardcode_minus_L=yes - ;; - esac -@@ -10901,7 +10901,7 @@ - case $cc_basename in - cl*) - # Native MSVC -- hardcode_libdir_flag_spec=' ' -+ hardcode_libdir_flag_spec=" " - allow_undefined_flag=unsupported - always_export_symbols=yes - file_list_spec='@' -@@ -10942,7 +10942,7 @@ - ;; - *) - # Assume MSVC wrapper -- hardcode_libdir_flag_spec=' ' -+ hardcode_libdir_flag_spec=" " - allow_undefined_flag=unsupported - # Tell ltmain to make .lib files, not .a files. - libext=lib -@@ -10993,7 +10993,7 @@ - - dgux*) - archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' -- hardcode_libdir_flag_spec='-L$libdir' -+ hardcode_libdir_flag_spec=" " - hardcode_shlibpath_var=no - ;; - -@@ -11003,7 +11003,7 @@ - # extra space). - freebsd2.2*) - archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' -- hardcode_libdir_flag_spec='-R$libdir' -+ hardcode_libdir_flag_spec=" " - hardcode_direct=yes - hardcode_shlibpath_var=no - ;; -@@ -11019,7 +11019,7 @@ - # FreeBSD 3 and greater uses gcc -shared to do shared libraries. - freebsd* | dragonfly*) - archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' -- hardcode_libdir_flag_spec='-R$libdir' -+ hardcode_libdir_flag_spec=" " - hardcode_direct=yes - hardcode_shlibpath_var=no - ;; -@@ -11030,7 +11030,7 @@ - else - archive_cmds='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib' - fi -- hardcode_libdir_flag_spec='$wl+b $wl$libdir' -+ hardcode_libdir_flag_spec=" " - hardcode_libdir_separator=: - hardcode_direct=yes - -@@ -11047,7 +11047,7 @@ - archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' - fi - if test no = "$with_gnu_ld"; then -- hardcode_libdir_flag_spec='$wl+b $wl$libdir' -+ hardcode_libdir_flag_spec=" " - hardcode_libdir_separator=: - hardcode_direct=yes - hardcode_direct_absolute=yes -@@ -11124,7 +11124,7 @@ - esac - fi - if test no = "$with_gnu_ld"; then -- hardcode_libdir_flag_spec='$wl+b $wl$libdir' -+ hardcode_libdir_flag_spec=" " - hardcode_libdir_separator=: - - case $host_cpu in -@@ -11183,7 +11183,7 @@ - archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -exports_file $export_symbols -o $lib' - fi - archive_cmds_need_lc='no' -- hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' -+ hardcode_libdir_flag_spec=" " - hardcode_libdir_separator=: - inherit_rpath=yes - link_all_deplibs=yes -@@ -11205,7 +11205,7 @@ - else - archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF - fi -- hardcode_libdir_flag_spec='-R$libdir' -+ hardcode_libdir_flag_spec=" " - hardcode_direct=yes - hardcode_shlibpath_var=no - ;; -@@ -11213,7 +11213,7 @@ - newsos6) - archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_direct=yes -- hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' -+ hardcode_libdir_flag_spec=" " - hardcode_libdir_separator=: - hardcode_shlibpath_var=no - ;; -@@ -11229,11 +11229,11 @@ - if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then - archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags $wl-retain-symbols-file,$export_symbols' -- hardcode_libdir_flag_spec='$wl-rpath,$libdir' -+ hardcode_libdir_flag_spec=" " - export_dynamic_flag_spec='$wl-E' - else - archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' -- hardcode_libdir_flag_spec='$wl-rpath,$libdir' -+ hardcode_libdir_flag_spec=" " - fi - else - ld_shlibs=no -@@ -11241,7 +11241,7 @@ - ;; - - os2*) -- hardcode_libdir_flag_spec='-L$libdir' -+ hardcode_libdir_flag_spec=" " - hardcode_minus_L=yes - allow_undefined_flag=unsupported - shrext_cmds=.dll -@@ -11277,7 +11277,7 @@ - archive_cmds='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' - fi - archive_cmds_need_lc='no' -- hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' -+ hardcode_libdir_flag_spec=" " - hardcode_libdir_separator=: - ;; - -@@ -11285,7 +11285,7 @@ - if test yes = "$GCC"; then - allow_undefined_flag=' $wl-expect_unresolved $wl\*' - archive_cmds='$CC -shared$allow_undefined_flag $pic_flag $libobjs $deplibs $compiler_flags $wl-msym $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' -- hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' -+ hardcode_libdir_flag_spec=" " - else - allow_undefined_flag=' -expect_unresolved \*' - archive_cmds='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' -@@ -11293,7 +11293,7 @@ - $CC -shared$allow_undefined_flag $wl-input $wl$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib~$RM $lib.exp' - - # Both c and cxx compiler support -rpath directly -- hardcode_libdir_flag_spec='-rpath $libdir' -+ hardcode_libdir_flag_spec=" " - fi - archive_cmds_need_lc='no' - hardcode_libdir_separator=: -@@ -11322,7 +11322,7 @@ - ;; - esac - fi -- hardcode_libdir_flag_spec='-R$libdir' -+ hardcode_libdir_flag_spec=" " - hardcode_shlibpath_var=no - case $host_os in - solaris2.[0-5] | solaris2.[0-5].*) ;; -@@ -11349,7 +11349,7 @@ - else - archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' - fi -- hardcode_libdir_flag_spec='-L$libdir' -+ hardcode_libdir_flag_spec=" " - hardcode_direct=yes - hardcode_minus_L=yes - hardcode_shlibpath_var=no -@@ -11419,7 +11419,7 @@ - allow_undefined_flag='$wl-z,nodefs' - archive_cmds_need_lc=no - hardcode_shlibpath_var=no -- hardcode_libdir_flag_spec='$wl-R,$libdir' -+ hardcode_libdir_flag_spec=" " - hardcode_libdir_separator=':' - link_all_deplibs=yes - export_dynamic_flag_spec='$wl-Bexport' -@@ -11436,7 +11436,7 @@ - - uts4*) - archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' -- hardcode_libdir_flag_spec='-L$libdir' -+ hardcode_libdir_flag_spec=" " - hardcode_shlibpath_var=no - ;; - -@@ -11804,7 +11804,7 @@ - version_type=linux # correct to gnu/linux during the next big refactor - need_lib_prefix=no - need_version=no -- hardcode_into_libs=yes -+ hardcode_into_libs=no - if test ia64 = "$host_cpu"; then - # AIX 5 supports IA64 - library_names_spec='$libname$release$shared_ext$major $libname$release$shared_ext$versuffix $libname$shared_ext' -@@ -12094,16 +12094,16 @@ - ;; - freebsd3.[01]* | freebsdelf3.[01]*) - shlibpath_overrides_runpath=yes -- hardcode_into_libs=yes -+ hardcode_into_libs=no - ;; - freebsd3.[2-9]* | freebsdelf3.[2-9]* | \ - freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1) - shlibpath_overrides_runpath=no -- hardcode_into_libs=yes -+ hardcode_into_libs=no - ;; - *) # from 4.6 on, and DragonFly - shlibpath_overrides_runpath=yes -- hardcode_into_libs=yes -+ hardcode_into_libs=no - ;; - esac - ;; -@@ -12118,7 +12118,7 @@ - shlibpath_var=LIBRARY_PATH - shlibpath_overrides_runpath=no - sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib' -- hardcode_into_libs=yes -+ hardcode_into_libs=no - ;; - - hpux9* | hpux10* | hpux11*) -@@ -12130,7 +12130,7 @@ - case $host_cpu in - ia64*) - shrext_cmds='.so' -- hardcode_into_libs=yes -+ hardcode_into_libs=no - dynamic_linker="$host_os dld.so" - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. -@@ -12146,7 +12146,7 @@ - ;; - hppa*64*) - shrext_cmds='.sl' -- hardcode_into_libs=yes -+ hardcode_into_libs=no - dynamic_linker="$host_os dld.sl" - shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH - shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. -@@ -12179,7 +12179,7 @@ - dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no -- hardcode_into_libs=yes -+ hardcode_into_libs=no - ;; - - irix5* | irix6* | nonstopux*) -@@ -12216,7 +12216,7 @@ - shlibpath_overrides_runpath=no - sys_lib_search_path_spec="/usr/lib$libsuff /lib$libsuff /usr/local/lib$libsuff" - sys_lib_dlsearch_path_spec="/usr/lib$libsuff /lib$libsuff" -- hardcode_into_libs=yes -+ hardcode_into_libs=no - ;; - - # No shared lib support for Linux oldld, aout, or coff. -@@ -12237,11 +12237,11 @@ - # This implies no fast_install, which is unacceptable. - # Some rework will be needed to allow for fast_install - # before this can be enabled. -- hardcode_into_libs=yes -+ hardcode_into_libs=no - - dynamic_linker='Android linker' - # Don't embed -rpath directories since the linker doesn't support them. -- hardcode_libdir_flag_spec='-L$libdir' -+ hardcode_libdir_flag_spec=" " - ;; - - # This must be glibc/ELF. -@@ -12292,7 +12292,7 @@ - # This implies no fast_install, which is unacceptable. - # Some rework will be needed to allow for fast_install - # before this can be enabled. -- hardcode_into_libs=yes -+ hardcode_into_libs=no - - # Ideally, we could use ldconfig to report *all* directores which are - # searched for libraries, however this is still not possible. Aside from not -@@ -12322,7 +12322,7 @@ - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no -- hardcode_into_libs=yes -+ hardcode_into_libs=no - dynamic_linker='NetBSD ld.elf_so' - ;; - -@@ -12341,7 +12341,7 @@ - fi - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes -- hardcode_into_libs=yes -+ hardcode_into_libs=no - ;; - - newsos6) -@@ -12359,7 +12359,7 @@ - soname_spec='$libname$release$shared_ext$major' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no -- hardcode_into_libs=yes -+ hardcode_into_libs=no - dynamic_linker='ldqnx.so' - ;; - -@@ -12431,7 +12431,7 @@ - soname_spec='$libname$release$shared_ext$major' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes -- hardcode_into_libs=yes -+ hardcode_into_libs=no - # ldd complains unless libraries are executable - postinstall_cmds='chmod +x $lib' - ;; -@@ -12488,7 +12488,7 @@ - soname_spec='$libname$release$shared_ext$major' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes -- hardcode_into_libs=yes -+ hardcode_into_libs=no - if test yes = "$with_gnu_ld"; then - sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' - else -@@ -12510,7 +12510,7 @@ - library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no -- hardcode_into_libs=yes -+ hardcode_into_libs=no - ;; - - uts4*) -@@ -13610,7 +13610,7 @@ - acl_shlibext="$acl_cv_shlibext" - acl_libname_spec="$acl_cv_libname_spec" - acl_library_names_spec="$acl_cv_library_names_spec" -- acl_hardcode_libdir_flag_spec="$acl_cv_hardcode_libdir_flag_spec" -+ acl_hardcode_libdir_flag_spec=" " - acl_hardcode_libdir_separator="$acl_cv_hardcode_libdir_separator" - acl_hardcode_direct="$acl_cv_hardcode_direct" - acl_hardcode_minus_L="$acl_cv_hardcode_minus_L" -@@ -21296,7 +21296,7 @@ - with_gnu_ld='`$ECHO "$with_gnu_ld" | $SED "$delay_single_quote_subst"`' - allow_undefined_flag='`$ECHO "$allow_undefined_flag" | $SED "$delay_single_quote_subst"`' - no_undefined_flag='`$ECHO "$no_undefined_flag" | $SED "$delay_single_quote_subst"`' --hardcode_libdir_flag_spec='`$ECHO "$hardcode_libdir_flag_spec" | $SED "$delay_single_quote_subst"`' -+hardcode_libdir_flag_spec=" " - hardcode_libdir_separator='`$ECHO "$hardcode_libdir_separator" | $SED "$delay_single_quote_subst"`' - hardcode_direct='`$ECHO "$hardcode_direct" | $SED "$delay_single_quote_subst"`' - hardcode_direct_absolute='`$ECHO "$hardcode_direct_absolute" | $SED "$delay_single_quote_subst"`' -@@ -21327,7 +21327,7 @@ - postuninstall_cmds='`$ECHO "$postuninstall_cmds" | $SED "$delay_single_quote_subst"`' - finish_cmds='`$ECHO "$finish_cmds" | $SED "$delay_single_quote_subst"`' - finish_eval='`$ECHO "$finish_eval" | $SED "$delay_single_quote_subst"`' --hardcode_into_libs='`$ECHO "$hardcode_into_libs" | $SED "$delay_single_quote_subst"`' -+hardcode_into_libs=no - sys_lib_search_path_spec='`$ECHO "$sys_lib_search_path_spec" | $SED "$delay_single_quote_subst"`' - configure_time_dlsearch_path='`$ECHO "$configure_time_dlsearch_path" | $SED "$delay_single_quote_subst"`' - configure_time_lt_sys_library_path='`$ECHO "$configure_time_lt_sys_library_path" | $SED "$delay_single_quote_subst"`' -@@ -22485,7 +22485,7 @@ - finish_eval=$lt_finish_eval - - # Whether we should hardcode library paths into libraries. --hardcode_into_libs=$hardcode_into_libs -+hardcode_into_libs=no - - # Compile-time system search path for libraries. - sys_lib_search_path_spec=$lt_sys_lib_search_path_spec -@@ -22582,7 +22582,7 @@ - - # Flag to hardcode \$libdir into a binary during linking. - # This must work even if \$libdir does not exist --hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec -+hardcode_libdir_flag_spec=" " - - # Whether we need a single "-rpath" flag with a separated argument. - hardcode_libdir_separator=$lt_hardcode_libdir_separator diff -u -r cryptsetup-2.3.3-clean/Makefile.in cryptsetup-2.3.3/Makefile.in --- cryptsetup-2.3.3-clean/Makefile.in 2020-06-10 14:05:45.781594282 +0200 -+++ cryptsetup-2.3.3/Makefile.in 2020-06-10 14:30:09.512375745 +0200 -@@ -1032,6 +1032,8 @@ ++++ cryptsetup-2.3.3/Makefile.in 2020-06-11 13:59:03.728478073 +0200 +@@ -1032,6 +1032,7 @@ @CRYPTSETUP_TRUE@cryptsetup_LDADD = $(LDADD) \ @CRYPTSETUP_TRUE@ libcryptsetup.la \ @CRYPTSETUP_TRUE@ @POPT_LIBS@ \ -+@CRYPTSETUP_TRUE@ @UUID_LIBS@ \ +@CRYPTSETUP_TRUE@ @DEVMAPPER_LIBS@ \ @CRYPTSETUP_TRUE@ @PWQUALITY_LIBS@ \ @CRYPTSETUP_TRUE@ @PASSWDQC_LIBS@ \ @CRYPTSETUP_TRUE@ @UUID_LIBS@ \ -@@ -1060,6 +1062,8 @@ +@@ -1060,8 +1061,10 @@ @VERITYSETUP_TRUE@veritysetup_LDADD = $(LDADD) \ @VERITYSETUP_TRUE@ libcryptsetup.la \ @VERITYSETUP_TRUE@ @POPT_LIBS@ \ -+@VERITYSETUP_TRUE@ @UUID_LIBS@ \ +@VERITYSETUP_TRUE@ @DEVMAPPER_LIBS@ \ @VERITYSETUP_TRUE@ @PWQUALITY_LIBS@ \ @VERITYSETUP_TRUE@ @PASSWDQC_LIBS@ \ ++@VERITYSETUP_TRUE@ @UUID_LIBS@ \ @VERITYSETUP_TRUE@ @BLKID_LIBS@ + + @STATIC_TOOLS_TRUE@@VERITYSETUP_TRUE@veritysetup_static_SOURCES = $(veritysetup_SOURCES) +@@ -1112,6 +1115,7 @@ + @REENCRYPT_TRUE@cryptsetup_reencrypt_LDADD = $(LDADD) \ + @REENCRYPT_TRUE@ libcryptsetup.la \ + @REENCRYPT_TRUE@ @POPT_LIBS@ \ ++@REENCRYPT_TRUE@ @DEVMAPPER_LIBS@ \ + @REENCRYPT_TRUE@ @PWQUALITY_LIBS@ \ + @REENCRYPT_TRUE@ @PASSWDQC_LIBS@ \ + @REENCRYPT_TRUE@ @UUID_LIBS@ \ From ff58f1524d3cb3f51dfadfa4afa073f5699c6d9e Mon Sep 17 00:00:00 2001 From: alex-nitrokey Date: Tue, 16 Jun 2020 10:29:01 +0200 Subject: [PATCH 05/10] Fix build issue * use --libdir to fix issue with .la files which had //lib as lib folder * add libblkid as library --- modules/cryptsetup | 11 +- modules/util-linux | 7 +- patches/cryptsetup-2.3.3.patch | 525 ++++++++++++++++++++++++++++++++- 3 files changed, 521 insertions(+), 22 deletions(-) diff --git a/modules/cryptsetup b/modules/cryptsetup index 8ed526ef..74b33f72 100644 --- a/modules/cryptsetup +++ b/modules/cryptsetup @@ -14,7 +14,8 @@ cryptsetup_configure := ./configure \ $(CROSS_TOOLS) \ --host i386-elf-linux \ --prefix "/" \ - --disable-rpath \ + --disable-gcrypt-pbkdf2 \ + --enable-cryptsetup-reencrypt \ --with-crypto_backend=kernel \ # but after building, replace prefix so that they will be installed @@ -47,10 +48,12 @@ json-c_hash := 99914e644a25201d82ccefa20430f7515c110923360f9ef46755527c02412afa # there is a bug in cmake-configure so that it can not be used with a "=", fxed in next # release though (then it needs to read '--prefix="$(INSTALL)"' here instead -json-c_configure := mkdir build && \ +json-c_configure := mkdir -p build && \ cd build && \ ../cmake-configure --prefix "$(INSTALL)" -json-c_target := $(CROSS_TOOLS) -C $(build)/$(json-c_dir)/build all install +json-c_target := \ + $(CROSS_TOOLS) -C $(build)/$(json-c_dir)/build \ + all install -json-c_libraries := build/libjson-c.so.5.0.0 +json-c_libraries := build/.libs/libjson-c.so.5.0.0 diff --git a/modules/util-linux b/modules/util-linux index e3377f60..70d2c9d3 100644 --- a/modules/util-linux +++ b/modules/util-linux @@ -28,9 +28,8 @@ util-linux_target := \ DESTDIR="$(INSTALL)" \ install -util-linux_libraries += .libs/libuuid.so.1 - -# libblkid is not needed by lvm2, so it is not installed now -#util-linux_libraries += .libs/libblkid.so.1 +util-linux_libraries += \ + .libs/libuuid.so.1 \ + .libs/libblkid.so.1 \ util-linux_depends := $(musl_dep) diff --git a/patches/cryptsetup-2.3.3.patch b/patches/cryptsetup-2.3.3.patch index 22f8d34d..644d9a6c 100644 --- a/patches/cryptsetup-2.3.3.patch +++ b/patches/cryptsetup-2.3.3.patch @@ -1,30 +1,527 @@ +diff -u -r cryptsetup-2.3.3-clean/configure cryptsetup-2.3.3/configure +--- cryptsetup-2.3.3-clean/configure 2020-06-10 14:05:45.784925972 +0200 ++++ cryptsetup-2.3.3/configure 2020-06-10 14:12:03.811651237 +0200 +@@ -10206,7 +10206,7 @@ + hardcode_automatic=no + hardcode_direct=no + hardcode_direct_absolute=no +- hardcode_libdir_flag_spec= ++ hardcode_libdir_flag_spec=" " + hardcode_libdir_separator= + hardcode_minus_L=no + hardcode_shlibpath_var=unsupported +@@ -10290,7 +10290,7 @@ + # are reset later if shared libraries are not supported. Putting them + # here allows them to be overridden if necessary. + runpath_var=LD_RUN_PATH +- hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' ++ hardcode_libdir_flag_spec=" " + export_dynamic_flag_spec='$wl--export-dynamic' + # ancient GNU ld didn't support --whole-archive et. al. + if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then +@@ -10336,7 +10336,7 @@ + ;; + m68k) + archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' +- hardcode_libdir_flag_spec='-L$libdir' ++ hardcode_libdir_flag_spec=" " + hardcode_minus_L=yes + ;; + esac +@@ -10356,7 +10356,7 @@ + cygwin* | mingw* | pw32* | cegcc*) + # _LT_TAGVAR(hardcode_libdir_flag_spec, ) is actually meaningless, + # as there is no search path for DLLs. +- hardcode_libdir_flag_spec='-L$libdir' ++ hardcode_libdir_flag_spec=" " + export_dynamic_flag_spec='$wl--export-all-symbols' + allow_undefined_flag=unsupported + always_export_symbols=no +@@ -10386,7 +10386,7 @@ + ;; + + os2*) +- hardcode_libdir_flag_spec='-L$libdir' ++ hardcode_libdir_flag_spec=" " + hardcode_minus_L=yes + allow_undefined_flag=unsupported + shrext_cmds=.dll +@@ -10416,7 +10416,7 @@ + interix[3-9]*) + hardcode_direct=no + hardcode_shlibpath_var=no +- hardcode_libdir_flag_spec='$wl-rpath,$libdir' ++ hardcode_libdir_flag_spec=" " + export_dynamic_flag_spec='$wl-E' + # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. + # Instead, shared libraries are loaded at an image base (0x10000000 by +@@ -10492,7 +10492,7 @@ + xlf* | bgf* | bgxlf* | mpixlf*) + # IBM XL Fortran 10.1 on PPC cannot create shared libs itself + whole_archive_flag_spec='--whole-archive$convenience --no-whole-archive' +- hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' ++ hardcode_libdir_flag_spec=" " + archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib' + if test yes = "$supports_anon_versioning"; then + archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~ +@@ -10559,7 +10559,7 @@ + # DT_RUNPATH tag from executables and libraries. But doing so + # requires that you compile everything twice, which is a pain. + if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then +- hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' ++ hardcode_libdir_flag_spec=" " + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' + archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' + else +@@ -10588,7 +10588,7 @@ + + if test no = "$ld_shlibs"; then + runpath_var= +- hardcode_libdir_flag_spec= ++ hardcode_libdir_flag_spec=" " + export_dynamic_flag_spec= + whole_archive_flag_spec= + fi +@@ -10706,7 +10706,7 @@ + # path is not listed in the libpath. Setting hardcode_minus_L + # to unsupported forces relinking + hardcode_minus_L=yes +- hardcode_libdir_flag_spec='-L$libdir' ++ hardcode_libdir_flag_spec=" " + hardcode_libdir_separator= + fi + ;; +@@ -10790,11 +10790,11 @@ + aix_libpath=$lt_cv_aix_libpath_ + fi + +- hardcode_libdir_flag_spec='$wl-blibpath:$libdir:'"$aix_libpath" ++ hardcode_libdir_flag_spec=" " + archive_expsym_cmds='$CC -o $output_objdir/$soname $libobjs $deplibs $wl'$no_entry_flag' $compiler_flags `if test -n "$allow_undefined_flag"; then func_echo_all "$wl$allow_undefined_flag"; else :; fi` $wl'$exp_sym_flag:\$export_symbols' '$shared_flag + else + if test ia64 = "$host_cpu"; then +- hardcode_libdir_flag_spec='$wl-R $libdir:/usr/lib:/lib' ++ hardcode_libdir_flag_spec=" " + allow_undefined_flag="-z nodefs" + archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\$wl$no_entry_flag"' $compiler_flags $wl$allow_undefined_flag '"\$wl$exp_sym_flag:\$export_symbols" + else +@@ -10843,7 +10843,7 @@ + aix_libpath=$lt_cv_aix_libpath_ + fi + +- hardcode_libdir_flag_spec='$wl-blibpath:$libdir:'"$aix_libpath" ++ hardcode_libdir_flag_spec=" " + # Warning - without using the other run time loading flags, + # -berok will link without error, but may produce a broken library. + no_undefined_flag=' $wl-bernotok' +@@ -10883,7 +10883,7 @@ + ;; + m68k) + archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' +- hardcode_libdir_flag_spec='-L$libdir' ++ hardcode_libdir_flag_spec=" " + hardcode_minus_L=yes + ;; + esac +@@ -10901,7 +10901,7 @@ + case $cc_basename in + cl*) + # Native MSVC +- hardcode_libdir_flag_spec=' ' ++ hardcode_libdir_flag_spec=" " + allow_undefined_flag=unsupported + always_export_symbols=yes + file_list_spec='@' +@@ -10942,7 +10942,7 @@ + ;; + *) + # Assume MSVC wrapper +- hardcode_libdir_flag_spec=' ' ++ hardcode_libdir_flag_spec=" " + allow_undefined_flag=unsupported + # Tell ltmain to make .lib files, not .a files. + libext=lib +@@ -10993,7 +10993,7 @@ + + dgux*) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' +- hardcode_libdir_flag_spec='-L$libdir' ++ hardcode_libdir_flag_spec=" " + hardcode_shlibpath_var=no + ;; + +@@ -11003,7 +11003,7 @@ + # extra space). + freebsd2.2*) + archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' +- hardcode_libdir_flag_spec='-R$libdir' ++ hardcode_libdir_flag_spec=" " + hardcode_direct=yes + hardcode_shlibpath_var=no + ;; +@@ -11019,7 +11019,7 @@ + # FreeBSD 3 and greater uses gcc -shared to do shared libraries. + freebsd* | dragonfly*) + archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' +- hardcode_libdir_flag_spec='-R$libdir' ++ hardcode_libdir_flag_spec=" " + hardcode_direct=yes + hardcode_shlibpath_var=no + ;; +@@ -11030,7 +11030,7 @@ + else + archive_cmds='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib' + fi +- hardcode_libdir_flag_spec='$wl+b $wl$libdir' ++ hardcode_libdir_flag_spec=" " + hardcode_libdir_separator=: + hardcode_direct=yes + +@@ -11047,7 +11047,7 @@ + archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' + fi + if test no = "$with_gnu_ld"; then +- hardcode_libdir_flag_spec='$wl+b $wl$libdir' ++ hardcode_libdir_flag_spec=" " + hardcode_libdir_separator=: + hardcode_direct=yes + hardcode_direct_absolute=yes +@@ -11124,7 +11124,7 @@ + esac + fi + if test no = "$with_gnu_ld"; then +- hardcode_libdir_flag_spec='$wl+b $wl$libdir' ++ hardcode_libdir_flag_spec=" " + hardcode_libdir_separator=: + + case $host_cpu in +@@ -11183,7 +11183,7 @@ + archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -exports_file $export_symbols -o $lib' + fi + archive_cmds_need_lc='no' +- hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' ++ hardcode_libdir_flag_spec=" " + hardcode_libdir_separator=: + inherit_rpath=yes + link_all_deplibs=yes +@@ -11205,7 +11205,7 @@ + else + archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF + fi +- hardcode_libdir_flag_spec='-R$libdir' ++ hardcode_libdir_flag_spec=" " + hardcode_direct=yes + hardcode_shlibpath_var=no + ;; +@@ -11213,7 +11213,7 @@ + newsos6) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct=yes +- hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' ++ hardcode_libdir_flag_spec=" " + hardcode_libdir_separator=: + hardcode_shlibpath_var=no + ;; +@@ -11229,11 +11229,11 @@ + if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then + archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags $wl-retain-symbols-file,$export_symbols' +- hardcode_libdir_flag_spec='$wl-rpath,$libdir' ++ hardcode_libdir_flag_spec=" " + export_dynamic_flag_spec='$wl-E' + else + archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' +- hardcode_libdir_flag_spec='$wl-rpath,$libdir' ++ hardcode_libdir_flag_spec=" " + fi + else + ld_shlibs=no +@@ -11241,7 +11241,7 @@ + ;; + + os2*) +- hardcode_libdir_flag_spec='-L$libdir' ++ hardcode_libdir_flag_spec=" " + hardcode_minus_L=yes + allow_undefined_flag=unsupported + shrext_cmds=.dll +@@ -11277,7 +11277,7 @@ + archive_cmds='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' + fi + archive_cmds_need_lc='no' +- hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' ++ hardcode_libdir_flag_spec=" " + hardcode_libdir_separator=: + ;; + +@@ -11285,7 +11285,7 @@ + if test yes = "$GCC"; then + allow_undefined_flag=' $wl-expect_unresolved $wl\*' + archive_cmds='$CC -shared$allow_undefined_flag $pic_flag $libobjs $deplibs $compiler_flags $wl-msym $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' +- hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' ++ hardcode_libdir_flag_spec=" " + else + allow_undefined_flag=' -expect_unresolved \*' + archive_cmds='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' +@@ -11293,7 +11293,7 @@ + $CC -shared$allow_undefined_flag $wl-input $wl$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib~$RM $lib.exp' + + # Both c and cxx compiler support -rpath directly +- hardcode_libdir_flag_spec='-rpath $libdir' ++ hardcode_libdir_flag_spec=" " + fi + archive_cmds_need_lc='no' + hardcode_libdir_separator=: +@@ -11322,7 +11322,7 @@ + ;; + esac + fi +- hardcode_libdir_flag_spec='-R$libdir' ++ hardcode_libdir_flag_spec=" " + hardcode_shlibpath_var=no + case $host_os in + solaris2.[0-5] | solaris2.[0-5].*) ;; +@@ -11349,7 +11349,7 @@ + else + archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' + fi +- hardcode_libdir_flag_spec='-L$libdir' ++ hardcode_libdir_flag_spec=" " + hardcode_direct=yes + hardcode_minus_L=yes + hardcode_shlibpath_var=no +@@ -11419,7 +11419,7 @@ + allow_undefined_flag='$wl-z,nodefs' + archive_cmds_need_lc=no + hardcode_shlibpath_var=no +- hardcode_libdir_flag_spec='$wl-R,$libdir' ++ hardcode_libdir_flag_spec=" " + hardcode_libdir_separator=':' + link_all_deplibs=yes + export_dynamic_flag_spec='$wl-Bexport' +@@ -11436,7 +11436,7 @@ + + uts4*) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' +- hardcode_libdir_flag_spec='-L$libdir' ++ hardcode_libdir_flag_spec=" " + hardcode_shlibpath_var=no + ;; + +@@ -11804,7 +11804,7 @@ + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no +- hardcode_into_libs=yes ++ hardcode_into_libs=no + if test ia64 = "$host_cpu"; then + # AIX 5 supports IA64 + library_names_spec='$libname$release$shared_ext$major $libname$release$shared_ext$versuffix $libname$shared_ext' +@@ -12094,16 +12094,16 @@ + ;; + freebsd3.[01]* | freebsdelf3.[01]*) + shlibpath_overrides_runpath=yes +- hardcode_into_libs=yes ++ hardcode_into_libs=no + ;; + freebsd3.[2-9]* | freebsdelf3.[2-9]* | \ + freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1) + shlibpath_overrides_runpath=no +- hardcode_into_libs=yes ++ hardcode_into_libs=no + ;; + *) # from 4.6 on, and DragonFly + shlibpath_overrides_runpath=yes +- hardcode_into_libs=yes ++ hardcode_into_libs=no + ;; + esac + ;; +@@ -12118,7 +12118,7 @@ + shlibpath_var=LIBRARY_PATH + shlibpath_overrides_runpath=no + sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib' +- hardcode_into_libs=yes ++ hardcode_into_libs=no + ;; + + hpux9* | hpux10* | hpux11*) +@@ -12130,7 +12130,7 @@ + case $host_cpu in + ia64*) + shrext_cmds='.so' +- hardcode_into_libs=yes ++ hardcode_into_libs=no + dynamic_linker="$host_os dld.so" + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. +@@ -12146,7 +12146,7 @@ + ;; + hppa*64*) + shrext_cmds='.sl' +- hardcode_into_libs=yes ++ hardcode_into_libs=no + dynamic_linker="$host_os dld.sl" + shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH + shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. +@@ -12179,7 +12179,7 @@ + dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no +- hardcode_into_libs=yes ++ hardcode_into_libs=no + ;; + + irix5* | irix6* | nonstopux*) +@@ -12216,7 +12216,7 @@ + shlibpath_overrides_runpath=no + sys_lib_search_path_spec="/usr/lib$libsuff /lib$libsuff /usr/local/lib$libsuff" + sys_lib_dlsearch_path_spec="/usr/lib$libsuff /lib$libsuff" +- hardcode_into_libs=yes ++ hardcode_into_libs=no + ;; + + # No shared lib support for Linux oldld, aout, or coff. +@@ -12237,11 +12237,11 @@ + # This implies no fast_install, which is unacceptable. + # Some rework will be needed to allow for fast_install + # before this can be enabled. +- hardcode_into_libs=yes ++ hardcode_into_libs=no + + dynamic_linker='Android linker' + # Don't embed -rpath directories since the linker doesn't support them. +- hardcode_libdir_flag_spec='-L$libdir' ++ hardcode_libdir_flag_spec=" " + ;; + + # This must be glibc/ELF. +@@ -12292,7 +12292,7 @@ + # This implies no fast_install, which is unacceptable. + # Some rework will be needed to allow for fast_install + # before this can be enabled. +- hardcode_into_libs=yes ++ hardcode_into_libs=no + + # Ideally, we could use ldconfig to report *all* directores which are + # searched for libraries, however this is still not possible. Aside from not +@@ -12322,7 +12322,7 @@ + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no +- hardcode_into_libs=yes ++ hardcode_into_libs=no + dynamic_linker='NetBSD ld.elf_so' + ;; + +@@ -12341,7 +12341,7 @@ + fi + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes +- hardcode_into_libs=yes ++ hardcode_into_libs=no + ;; + + newsos6) +@@ -12359,7 +12359,7 @@ + soname_spec='$libname$release$shared_ext$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no +- hardcode_into_libs=yes ++ hardcode_into_libs=no + dynamic_linker='ldqnx.so' + ;; + +@@ -12431,7 +12431,7 @@ + soname_spec='$libname$release$shared_ext$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes +- hardcode_into_libs=yes ++ hardcode_into_libs=no + # ldd complains unless libraries are executable + postinstall_cmds='chmod +x $lib' + ;; +@@ -12488,7 +12488,7 @@ + soname_spec='$libname$release$shared_ext$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes +- hardcode_into_libs=yes ++ hardcode_into_libs=no + if test yes = "$with_gnu_ld"; then + sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' + else +@@ -12510,7 +12510,7 @@ + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no +- hardcode_into_libs=yes ++ hardcode_into_libs=no + ;; + + uts4*) +@@ -13610,7 +13610,7 @@ + acl_shlibext="$acl_cv_shlibext" + acl_libname_spec="$acl_cv_libname_spec" + acl_library_names_spec="$acl_cv_library_names_spec" +- acl_hardcode_libdir_flag_spec="$acl_cv_hardcode_libdir_flag_spec" ++ acl_hardcode_libdir_flag_spec=" " + acl_hardcode_libdir_separator="$acl_cv_hardcode_libdir_separator" + acl_hardcode_direct="$acl_cv_hardcode_direct" + acl_hardcode_minus_L="$acl_cv_hardcode_minus_L" +@@ -21296,7 +21296,7 @@ + with_gnu_ld='`$ECHO "$with_gnu_ld" | $SED "$delay_single_quote_subst"`' + allow_undefined_flag='`$ECHO "$allow_undefined_flag" | $SED "$delay_single_quote_subst"`' + no_undefined_flag='`$ECHO "$no_undefined_flag" | $SED "$delay_single_quote_subst"`' +-hardcode_libdir_flag_spec='`$ECHO "$hardcode_libdir_flag_spec" | $SED "$delay_single_quote_subst"`' ++hardcode_libdir_flag_spec=" " + hardcode_libdir_separator='`$ECHO "$hardcode_libdir_separator" | $SED "$delay_single_quote_subst"`' + hardcode_direct='`$ECHO "$hardcode_direct" | $SED "$delay_single_quote_subst"`' + hardcode_direct_absolute='`$ECHO "$hardcode_direct_absolute" | $SED "$delay_single_quote_subst"`' +@@ -21327,7 +21327,7 @@ + postuninstall_cmds='`$ECHO "$postuninstall_cmds" | $SED "$delay_single_quote_subst"`' + finish_cmds='`$ECHO "$finish_cmds" | $SED "$delay_single_quote_subst"`' + finish_eval='`$ECHO "$finish_eval" | $SED "$delay_single_quote_subst"`' +-hardcode_into_libs='`$ECHO "$hardcode_into_libs" | $SED "$delay_single_quote_subst"`' ++hardcode_into_libs=no + sys_lib_search_path_spec='`$ECHO "$sys_lib_search_path_spec" | $SED "$delay_single_quote_subst"`' + configure_time_dlsearch_path='`$ECHO "$configure_time_dlsearch_path" | $SED "$delay_single_quote_subst"`' + configure_time_lt_sys_library_path='`$ECHO "$configure_time_lt_sys_library_path" | $SED "$delay_single_quote_subst"`' +@@ -22485,7 +22485,7 @@ + finish_eval=$lt_finish_eval + + # Whether we should hardcode library paths into libraries. +-hardcode_into_libs=$hardcode_into_libs ++hardcode_into_libs=no + + # Compile-time system search path for libraries. + sys_lib_search_path_spec=$lt_sys_lib_search_path_spec +@@ -22582,7 +22582,7 @@ + + # Flag to hardcode \$libdir into a binary during linking. + # This must work even if \$libdir does not exist +-hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec ++hardcode_libdir_flag_spec=" " + + # Whether we need a single "-rpath" flag with a separated argument. + hardcode_libdir_separator=$lt_hardcode_libdir_separator diff -u -r cryptsetup-2.3.3-clean/Makefile.in cryptsetup-2.3.3/Makefile.in --- cryptsetup-2.3.3-clean/Makefile.in 2020-06-10 14:05:45.781594282 +0200 -+++ cryptsetup-2.3.3/Makefile.in 2020-06-11 13:59:03.728478073 +0200 -@@ -1032,6 +1032,7 @@ ++++ cryptsetup-2.3.3/Makefile.in 2020-06-10 14:30:09.512375745 +0200 +@@ -1032,6 +1032,8 @@ @CRYPTSETUP_TRUE@cryptsetup_LDADD = $(LDADD) \ @CRYPTSETUP_TRUE@ libcryptsetup.la \ @CRYPTSETUP_TRUE@ @POPT_LIBS@ \ ++@CRYPTSETUP_TRUE@ @UUID_LIBS@ \ +@CRYPTSETUP_TRUE@ @DEVMAPPER_LIBS@ \ @CRYPTSETUP_TRUE@ @PWQUALITY_LIBS@ \ @CRYPTSETUP_TRUE@ @PASSWDQC_LIBS@ \ @CRYPTSETUP_TRUE@ @UUID_LIBS@ \ -@@ -1060,8 +1061,10 @@ +@@ -1060,6 +1062,8 @@ @VERITYSETUP_TRUE@veritysetup_LDADD = $(LDADD) \ @VERITYSETUP_TRUE@ libcryptsetup.la \ @VERITYSETUP_TRUE@ @POPT_LIBS@ \ ++@VERITYSETUP_TRUE@ @UUID_LIBS@ \ +@VERITYSETUP_TRUE@ @DEVMAPPER_LIBS@ \ @VERITYSETUP_TRUE@ @PWQUALITY_LIBS@ \ @VERITYSETUP_TRUE@ @PASSWDQC_LIBS@ \ -+@VERITYSETUP_TRUE@ @UUID_LIBS@ \ @VERITYSETUP_TRUE@ @BLKID_LIBS@ - - @STATIC_TOOLS_TRUE@@VERITYSETUP_TRUE@veritysetup_static_SOURCES = $(veritysetup_SOURCES) -@@ -1112,6 +1115,7 @@ - @REENCRYPT_TRUE@cryptsetup_reencrypt_LDADD = $(LDADD) \ - @REENCRYPT_TRUE@ libcryptsetup.la \ - @REENCRYPT_TRUE@ @POPT_LIBS@ \ -+@REENCRYPT_TRUE@ @DEVMAPPER_LIBS@ \ - @REENCRYPT_TRUE@ @PWQUALITY_LIBS@ \ - @REENCRYPT_TRUE@ @PASSWDQC_LIBS@ \ - @REENCRYPT_TRUE@ @UUID_LIBS@ \ From 19c1e8f1afc52dc9764f7d2a867236d374a66287 Mon Sep 17 00:00:00 2001 From: alex-nitrokey Date: Tue, 16 Jun 2020 10:29:01 +0200 Subject: [PATCH 06/10] Clean up branch off testing stuff --- modules/cryptsetup | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/modules/cryptsetup b/modules/cryptsetup index 74b33f72..8631bebc 100644 --- a/modules/cryptsetup +++ b/modules/cryptsetup @@ -21,11 +21,10 @@ cryptsetup_configure := ./configure \ # but after building, replace prefix so that they will be installed # in the correct directory. cryptsetup_target := \ - $(MAKE_JOBS) \ - && $(MAKE) \ - -C $(build)/$(cryptsetup_dir) \ - prefix="$(INSTALL)" \ - install + $(MAKE) \ + -C $(build)/$(cryptsetup_dir) \ + prefix="$(INSTALL)" \ + install cryptsetup_output := \ src/.libs/cryptsetup \ From 07cc2b64f55a96ff475ae5bc2b6d139f3f116665 Mon Sep 17 00:00:00 2001 From: alex-nitrokey Date: Tue, 23 Jun 2020 11:03:17 +0200 Subject: [PATCH 07/10] Separate json-c module from cryptsetup module --- modules/cryptsetup | 33 ++++++--------------------------- modules/json-c | 21 +++++++++++++++++++-- 2 files changed, 25 insertions(+), 29 deletions(-) diff --git a/modules/cryptsetup b/modules/cryptsetup index 8631bebc..4f810dc9 100644 --- a/modules/cryptsetup +++ b/modules/cryptsetup @@ -1,6 +1,6 @@ modules-$(CONFIG_CRYPTSETUP) += cryptsetup -cryptsetup_depends := util-linux popt lvm2 $(musl_dep) +cryptsetup_depends := util-linux popt lvm2 json-c $(musl_dep) cryptsetup_version := 2.3.3 cryptsetup_dir := cryptsetup-$(cryptsetup_version) @@ -21,10 +21,11 @@ cryptsetup_configure := ./configure \ # but after building, replace prefix so that they will be installed # in the correct directory. cryptsetup_target := \ - $(MAKE) \ - -C $(build)/$(cryptsetup_dir) \ - prefix="$(INSTALL)" \ - install + $(MAKE_JOBS) \ + && $(MAKE) \ + -C $(build)/$(cryptsetup_dir) \ + prefix="$(INSTALL)" \ + install cryptsetup_output := \ src/.libs/cryptsetup \ @@ -34,25 +35,3 @@ cryptsetup_output := \ cryptsetup_libraries := \ lib/.libs/libcryptsetup.so.12.6.0 \ - -# json-c is needed since cryptsetup version 2.0 -cryptsetup_depends += json-c -modules-y += json-c - -json-c_version := 0.14 -json-c_dir := json-c-$(json-c_version) -json-c_tar := json-c-$(json-c_version).tar.gz -json-c_url := https://s3.amazonaws.com/json-c_releases/releases/json-c-$(json-c_version)-nodoc.tar.gz -json-c_hash := 99914e644a25201d82ccefa20430f7515c110923360f9ef46755527c02412afa - -# there is a bug in cmake-configure so that it can not be used with a "=", fxed in next -# release though (then it needs to read '--prefix="$(INSTALL)"' here instead -json-c_configure := mkdir -p build && \ - cd build && \ - ../cmake-configure --prefix "$(INSTALL)" - -json-c_target := \ - $(CROSS_TOOLS) -C $(build)/$(json-c_dir)/build \ - all install - -json-c_libraries := build/.libs/libjson-c.so.5.0.0 diff --git a/modules/json-c b/modules/json-c index 751a1630..9fba2894 100644 --- a/modules/json-c +++ b/modules/json-c @@ -1,2 +1,19 @@ -# empty placeholder file -# This submodule is defined in modules/cryptsetup +modules-$(CONFIG_CRYPTSETUP) += json-c + +json-c_version := 0.14 +json-c_dir := json-c-$(json-c_version) +json-c_tar := json-c-$(json-c_version).tar.gz +json-c_url := https://s3.amazonaws.com/json-c_releases/releases/json-c-$(json-c_version)-nodoc.tar.gz +json-c_hash := 99914e644a25201d82ccefa20430f7515c110923360f9ef46755527c02412afa + +# there is a bug in cmake-configure so that it can not be used with a "=", fxed in next +# release though (then it needs to read '--prefix="$(INSTALL)"' here instead +json-c_configure := mkdir -p build && \ + cd build && \ + ../cmake-configure --prefix "$(INSTALL)" + +json-c_target := \ + $(CROSS_TOOLS) -C $(build)/$(json-c_dir)/build \ + all install + +json-c_libraries := .libs/libjson-c.so.5.0.0 From 209c9778ad968d9f6e6b5255d5fe28c94e803e33 Mon Sep 17 00:00:00 2001 From: HardenedVault Date: Wed, 21 Oct 2020 16:04:00 +0200 Subject: [PATCH 08/10] Use -isystem instead of -I to introduce header files of target system If using -I to introduce header files, the elf.h in the target system instead of elf.h shipped with kexec-tools will be included, making its building process failed. --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index a0bda55b..23ffbfa6 100644 --- a/Makefile +++ b/Makefile @@ -111,7 +111,7 @@ heads_cc := $(CROSS)gcc \ -fdebug-prefix-map=$(pwd)=heads \ -gno-record-gcc-switches \ -D__MUSL__ \ - -I$(INSTALL)/include \ + -isystem $(INSTALL)/include \ -L$(INSTALL)/lib \ CROSS_TOOLS_NOCC := \ From 057cc3c377b26a7a189c8d13e80e29626d2e9ccd Mon Sep 17 00:00:00 2001 From: HardenedVault Date: Thu, 22 Oct 2020 13:16:00 +0200 Subject: [PATCH 09/10] [WIP] cross build json-c and cryptsetup --- initrd/run/cryptsetup/.placeholder | 0 modules/cryptsetup | 10 ++++++---- modules/json-c | 24 +++++++++++++++++++++--- modules/util-linux | 4 +++- patches/cryptsetup-2.3.3.patch | 23 +++++++++++++++++++++-- 5 files changed, 51 insertions(+), 10 deletions(-) create mode 100644 initrd/run/cryptsetup/.placeholder diff --git a/initrd/run/cryptsetup/.placeholder b/initrd/run/cryptsetup/.placeholder new file mode 100644 index 00000000..e69de29b diff --git a/modules/cryptsetup b/modules/cryptsetup index 4f810dc9..87f30473 100644 --- a/modules/cryptsetup +++ b/modules/cryptsetup @@ -14,9 +14,11 @@ cryptsetup_configure := ./configure \ $(CROSS_TOOLS) \ --host i386-elf-linux \ --prefix "/" \ + --disable-rpath \ --disable-gcrypt-pbkdf2 \ --enable-cryptsetup-reencrypt \ --with-crypto_backend=kernel \ + --with-tmpfilesdir=$(INSTALL)/lib/tmpfiles.d # but after building, replace prefix so that they will be installed # in the correct directory. @@ -28,10 +30,10 @@ cryptsetup_target := \ install cryptsetup_output := \ - src/.libs/cryptsetup \ - src/.libs/cryptsetup-reencrypt \ - src/.libs/veritysetup \ + .libs/cryptsetup \ + .libs/cryptsetup-reencrypt \ + .libs/veritysetup \ cryptsetup_libraries := \ - lib/.libs/libcryptsetup.so.12.6.0 \ + .libs/libcryptsetup.so.12 \ diff --git a/modules/json-c b/modules/json-c index 9fba2894..66166217 100644 --- a/modules/json-c +++ b/modules/json-c @@ -8,12 +8,30 @@ json-c_hash := 99914e644a25201d82ccefa20430f7515c110923360f9ef46755527c02412afa # there is a bug in cmake-configure so that it can not be used with a "=", fxed in next # release though (then it needs to read '--prefix="$(INSTALL)"' here instead -json-c_configure := mkdir -p build && \ +define toolchain_file = +set\(CMAKE_SYSTEM_NAME Linux\)\n\ +set\(CMAKE_SYSROOT $(INSTALL)\)\n\ +set\(CMAKE_C_COMPILER $(CROSS)gcc\)\n\ +set\(CMAKE_AR $(CROSS)ar\)\n\ +set\(CMAKE_LINKER $(CROSS)ld\)\n\ +set\(CMAKE_NM $(CROSS)nm\)\n\ +set\(CMAKE_OBJCOPY $(CROSS)objcopy\)\n\ +set\(CMAKE_OBJDUMP $(CROSS)objdump\)\n\ +set\(INSTALL_PKGCONFIG_DIR $(INSTALL)/lib/pkgconfig\)\n\ +set\(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER\)\n\ +set\(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY\)\n\ +set\(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY\)\n\ +set\(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY\) +endef + +json-c_configure := \ + echo -e "$(toolchain_file)" | sed 's/\\//g' > toolchain && \ + mkdir -p build && \ cd build && \ - ../cmake-configure --prefix "$(INSTALL)" + cmake .. -DCMAKE_INSTALL_PREFIX="$(INSTALL)" -DCMAKE_TOOLCHAIN_FILE=../toolchain json-c_target := \ $(CROSS_TOOLS) -C $(build)/$(json-c_dir)/build \ all install -json-c_libraries := .libs/libjson-c.so.5.0.0 +json-c_libraries := build/libjson-c.so.5 diff --git a/modules/util-linux b/modules/util-linux index 70d2c9d3..908ff3e7 100644 --- a/modules/util-linux +++ b/modules/util-linux @@ -26,7 +26,9 @@ util-linux_target := \ $(MAKE_JOBS) \ $(CROSS_TOOLS) \ DESTDIR="$(INSTALL)" \ - install + install && \ + rm $(INSTALL)/lib/libblkid.la && \ + rm $(INSTALL)/lib/libuuid.la util-linux_libraries += \ .libs/libuuid.so.1 \ diff --git a/patches/cryptsetup-2.3.3.patch b/patches/cryptsetup-2.3.3.patch index 644d9a6c..8a673ef8 100644 --- a/patches/cryptsetup-2.3.3.patch +++ b/patches/cryptsetup-2.3.3.patch @@ -511,17 +511,36 @@ diff -u -r cryptsetup-2.3.3-clean/Makefile.in cryptsetup-2.3.3/Makefile.in @CRYPTSETUP_TRUE@cryptsetup_LDADD = $(LDADD) \ @CRYPTSETUP_TRUE@ libcryptsetup.la \ @CRYPTSETUP_TRUE@ @POPT_LIBS@ \ -+@CRYPTSETUP_TRUE@ @UUID_LIBS@ \ +@CRYPTSETUP_TRUE@ @DEVMAPPER_LIBS@ \ ++@CRYPTSETUP_TRUE@ @JSON_C_LIBS@ \ @CRYPTSETUP_TRUE@ @PWQUALITY_LIBS@ \ @CRYPTSETUP_TRUE@ @PASSWDQC_LIBS@ \ @CRYPTSETUP_TRUE@ @UUID_LIBS@ \ -@@ -1060,6 +1062,8 @@ +@@ -1060,6 +1062,9 @@ @VERITYSETUP_TRUE@veritysetup_LDADD = $(LDADD) \ @VERITYSETUP_TRUE@ libcryptsetup.la \ @VERITYSETUP_TRUE@ @POPT_LIBS@ \ +@VERITYSETUP_TRUE@ @UUID_LIBS@ \ +@VERITYSETUP_TRUE@ @DEVMAPPER_LIBS@ \ ++@VERITYSETUP_TRUE@ @JSON_C_LIBS@ \ @VERITYSETUP_TRUE@ @PWQUALITY_LIBS@ \ @VERITYSETUP_TRUE@ @PASSWDQC_LIBS@ \ @VERITYSETUP_TRUE@ @BLKID_LIBS@ +@@ -1093,6 +1093,8 @@ + @INTEGRITYSETUP_TRUE@ libcryptsetup.la \ + @INTEGRITYSETUP_TRUE@ @POPT_LIBS@ \ + @INTEGRITYSETUP_TRUE@ @UUID_LIBS@ \ ++@INTEGRITYSETUP_TRUE@ @DEVMAPPER_LIBS@ \ ++@INTEGRITYSETUP_TRUE@ @JSON_C_LIBS@ \ + @INTEGRITYSETUP_TRUE@ @BLKID_LIBS@ + + @INTEGRITYSETUP_TRUE@@STATIC_TOOLS_TRUE@integritysetup_static_SOURCES = $(integritysetup_SOURCES) +@@ -1122,6 +1122,8 @@ + @REENCRYPT_TRUE@ @POPT_LIBS@ \ + @REENCRYPT_TRUE@ @PWQUALITY_LIBS@ \ + @REENCRYPT_TRUE@ @PASSWDQC_LIBS@ \ ++@REENCRYPT_TRUE@ @DEVMAPPER_LIBS@ \ ++@REENCRYPT_TRUE@ @JSON_C_LIBS@ \ + @REENCRYPT_TRUE@ @UUID_LIBS@ \ + @REENCRYPT_TRUE@ @BLKID_LIBS@ + From da7f6f734f64c8999aa46c8fd0bf200bb47ad752 Mon Sep 17 00:00:00 2001 From: HardenedVault Date: Fri, 11 Dec 2020 11:06:03 +0200 Subject: [PATCH 10/10] make cryptsetup1/cryptsetup2 optional --- modules/cryptsetup | 18 ++++----- modules/cryptsetup2 | 39 +++++++++++++++++++ modules/json-c | 2 +- patches/cryptsetup-1.7.3.patch | 21 ++++++++++ ...up-2.3.3.patch => cryptsetup2-2.3.3.patch} | 0 5 files changed, 69 insertions(+), 11 deletions(-) create mode 100644 modules/cryptsetup2 create mode 100644 patches/cryptsetup-1.7.3.patch rename patches/{cryptsetup-2.3.3.patch => cryptsetup2-2.3.3.patch} (100%) diff --git a/modules/cryptsetup b/modules/cryptsetup index 87f30473..4cea7f35 100644 --- a/modules/cryptsetup +++ b/modules/cryptsetup @@ -1,12 +1,12 @@ modules-$(CONFIG_CRYPTSETUP) += cryptsetup -cryptsetup_depends := util-linux popt lvm2 json-c $(musl_dep) +cryptsetup_depends := util-linux popt lvm2 $(musl_dep) -cryptsetup_version := 2.3.3 +cryptsetup_version := 1.7.3 cryptsetup_dir := cryptsetup-$(cryptsetup_version) cryptsetup_tar := cryptsetup-$(cryptsetup_version).tar.xz -cryptsetup_url := https://www.kernel.org/pub/linux/utils/cryptsetup/v2.3/cryptsetup-$(cryptsetup_version).tar.xz -cryptsetup_hash := 3bca4ffe39e2f94cef50f6ea65acb873a6dbce5db34fc6bcefe38b6d095e82df +cryptsetup_url := https://www.kernel.org/pub/linux/utils/cryptsetup/v1.7/cryptsetup-$(cryptsetup_version).tar.xz +cryptsetup_hash := af2b04e8475cf40b8d9ffd97a1acfa73aa787c890430afd89804fb544d6adc02 # Use an empty prefix so that the executables will not include the # build path. @@ -14,11 +14,9 @@ cryptsetup_configure := ./configure \ $(CROSS_TOOLS) \ --host i386-elf-linux \ --prefix "/" \ - --disable-rpath \ --disable-gcrypt-pbkdf2 \ --enable-cryptsetup-reencrypt \ --with-crypto_backend=kernel \ - --with-tmpfilesdir=$(INSTALL)/lib/tmpfiles.d # but after building, replace prefix so that they will be installed # in the correct directory. @@ -30,10 +28,10 @@ cryptsetup_target := \ install cryptsetup_output := \ - .libs/cryptsetup \ - .libs/cryptsetup-reencrypt \ - .libs/veritysetup \ + src/.libs/cryptsetup \ + src/.libs/cryptsetup-reencrypt \ + src/.libs/veritysetup \ cryptsetup_libraries := \ - .libs/libcryptsetup.so.12 \ + lib/.libs/libcryptsetup.so.4 \ diff --git a/modules/cryptsetup2 b/modules/cryptsetup2 new file mode 100644 index 00000000..af7fe381 --- /dev/null +++ b/modules/cryptsetup2 @@ -0,0 +1,39 @@ +modules-$(CONFIG_CRYPTSETUP2) += cryptsetup2 + +cryptsetup2_depends := util-linux popt lvm2 json-c $(musl_dep) + +cryptsetup2_version := 2.3.3 +cryptsetup2_dir := cryptsetup-$(cryptsetup2_version) +cryptsetup2_tar := cryptsetup-$(cryptsetup2_version).tar.xz +cryptsetup2_url := https://www.kernel.org/pub/linux/utils/cryptsetup/v2.3/cryptsetup-$(cryptsetup2_version).tar.xz +cryptsetup2_hash := 3bca4ffe39e2f94cef50f6ea65acb873a6dbce5db34fc6bcefe38b6d095e82df + +# Use an empty prefix so that the executables will not include the +# build path. +cryptsetup2_configure := ./configure \ + $(CROSS_TOOLS) \ + --host i386-elf-linux \ + --prefix "/" \ + --disable-rpath \ + --disable-gcrypt-pbkdf2 \ + --enable-cryptsetup-reencrypt \ + --with-crypto_backend=kernel \ + --with-tmpfilesdir=$(INSTALL)/lib/tmpfiles.d + +# but after building, replace prefix so that they will be installed +# in the correct directory. +cryptsetup2_target := \ + $(MAKE_JOBS) \ + && $(MAKE) \ + -C $(build)/$(cryptsetup2_dir) \ + prefix="$(INSTALL)" \ + install + +cryptsetup2_output := \ + .libs/cryptsetup \ + .libs/cryptsetup-reencrypt \ + .libs/veritysetup \ + +cryptsetup2_libraries := \ + .libs/libcryptsetup.so.12 \ + diff --git a/modules/json-c b/modules/json-c index 66166217..a3c14340 100644 --- a/modules/json-c +++ b/modules/json-c @@ -1,4 +1,4 @@ -modules-$(CONFIG_CRYPTSETUP) += json-c +modules-$(CONFIG_CRYPTSETUP2) += json-c json-c_version := 0.14 json-c_dir := json-c-$(json-c_version) diff --git a/patches/cryptsetup-1.7.3.patch b/patches/cryptsetup-1.7.3.patch new file mode 100644 index 00000000..c36d36fd --- /dev/null +++ b/patches/cryptsetup-1.7.3.patch @@ -0,0 +1,21 @@ +diff -u --recursive ../../clean/cryptsetup-1.7.3/src/Makefile.in ./cryptsetup-1.7.3/src/Makefile.in +--- ../../clean/cryptsetup-1.7.3/src/Makefile.in 2016-10-28 09:45:06.000000000 -0400 ++++ cryptsetup-1.7.3/src/Makefile.in 2017-01-27 17:24:13.115962328 -0500 +@@ -479,6 +479,8 @@ + cryptsetup_LDADD = \ + $(top_builddir)/lib/libcryptsetup.la \ + @POPT_LIBS@ \ ++ @UUID_LIBS@ \ ++ @DEVMAPPER_LIBS@ \ + @PWQUALITY_LIBS@ \ + @PASSWDQC_LIBS@ + +@@ -503,6 +505,8 @@ + + @VERITYSETUP_TRUE@veritysetup_LDADD = \ + @VERITYSETUP_TRUE@ $(top_builddir)/lib/libcryptsetup.la \ ++@VERITYSETUP_TRUE@ @UUID_LIBS@ \ ++@VERITYSETUP_TRUE@ @DEVMAPPER_LIBS@ \ + @VERITYSETUP_TRUE@ @POPT_LIBS@ + + @VERITYSETUP_TRUE@veritysetup_CFLAGS = $(cryptsetup_CFLAGS) diff --git a/patches/cryptsetup-2.3.3.patch b/patches/cryptsetup2-2.3.3.patch similarity index 100% rename from patches/cryptsetup-2.3.3.patch rename to patches/cryptsetup2-2.3.3.patch