Ticket #1302: 0001-configure.ac-fix-stack-protector-detection.patch

File 0001-configure.ac-fix-stack-protector-detection.patch, 2.1 KB (added by fabrice, 14 months ago)

Patch

  • smartmontools/configure.ac

    From 6bd18b0b7b4d916e474ba84707eb784a643b3e71 Mon Sep 17 00:00:00 2001
    From: Fabrice Fontaine <fontaine.fabrice@gmail.com>
    Date: Sun, 23 Feb 2020 16:23:20 +0100
    Subject: [PATCH] configure.ac: fix stack-protector detection
    
    Use AC_LINK_IFELSE instead of AC_COMPILE_IFELSE to check for
    stack-protector availability as some compilers could missed the needed
    library (-lssp or -lssp_nonshared) at linking step:
    
    /home/giuliobenetti/autobuild/run/instance-3/output-1/host/bin/x86_64-linux-g++  -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64  -Os   -Wall -W -Wformat=2 -fstack-protector-strong   -o smartctl smartctl.o atacmdnames.o atacmds.o ataidentify.o ataprint.o dev_ata_cmd_set.o dev_intelliprop.o dev_interface.o dev_jmb39x_raid.o json.o knowndrives.o nvmecmds.o nvmeprint.o scsicmds.o scsiata.o scsinvme.o scsiprint.o utility.o     os_linux.o cciss.o dev_areca.o    -lselinux
    /home/giuliobenetti/autobuild/run/instance-3/output-1/host/opt/ext-toolchain/bin/../lib/gcc/x86_64-buildroot-linux-uclibc/8.3.0/../../../../x86_64-buildroot-linux-uclibc/bin/ld: cannot find -lssp_nonshared
    /home/giuliobenetti/autobuild/run/instance-3/output-1/host/opt/ext-toolchain/bin/../lib/gcc/x86_64-buildroot-linux-uclibc/8.3.0/../../../../x86_64-buildroot-linux-uclibc/bin/ld: cannot find -lssp
    
    Fixes:
     - http://autobuild.buildroot.org/results/0de9f2a69fa2a39164211299f8a429d2fec6935a
    
    Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
    ---
     smartmontools/configure.ac | 2 +-
     1 file changed, 1 insertion(+), 1 deletion(-)
    
    diff --git a/smartmontools/configure.ac b/smartmontools/configure.ac
    index 87470d8a..ccb457e1 100644
    a b if test "$GXX" = "yes"; then 
    770770    AC_MSG_CHECKING([whether $CXX supports $option])
    771771    save_CXXFLAGS=$CXXFLAGS
    772772    CXXFLAGS="$CXXFLAGS $option"
    773     AC_COMPILE_IFELSE([AC_LANG_PROGRAM()], [res=yes], [res=no; CXXFLAGS=$save_CXXFLAGS])
     773    AC_LINK_IFELSE([AC_LANG_PROGRAM()], [res=yes], [res=no; CXXFLAGS=$save_CXXFLAGS])
    774774    AC_MSG_RESULT([$res])
    775775  done
    776776else