From patchwork Wed Nov 6 16:35:21 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eugene Yudin X-Patchwork-Id: 1190548 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=uclibc-ng.org (client-ip=2a00:1828:2000:679::23; helo=helium.openadk.org; envelope-from=devel-bounces@uclibc-ng.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=ndmsystems.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=ndmsystems-com.20150623.gappssmtp.com header.i=@ndmsystems-com.20150623.gappssmtp.com header.b="u0KwtEVX"; dkim-atps=neutral Received: from helium.openadk.org (helium.openadk.org [IPv6:2a00:1828:2000:679::23]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 477XG95hLCz9sP6 for ; Thu, 7 Nov 2019 03:35:43 +1100 (AEDT) Received: from helium.openadk.org (localhost [IPv6:::1]) by helium.openadk.org (Postfix) with ESMTP id 5C21C1009B; Wed, 6 Nov 2019 17:35:34 +0100 (CET) X-Original-To: devel@uclibc-ng.org Delivered-To: devel@helium.openadk.org Received: from mail-wr1-f65.google.com (mail-wr1-f65.google.com [209.85.221.65]) by helium.openadk.org (Postfix) with ESMTPS id DA11E1009B for ; Wed, 6 Nov 2019 17:35:30 +0100 (CET) Received: by mail-wr1-f65.google.com with SMTP id b3so20887731wrs.13 for ; Wed, 06 Nov 2019 08:35:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ndmsystems-com.20150623.gappssmtp.com; s=20150623; h=mime-version:from:date:message-id:subject:to; bh=/uaDbmcCn13OD0Ho/AwzHNYTMgWyU9YpyNJaWuRGLgM=; b=u0KwtEVXs0f/rV6DOw4av9NKznLaDk58BrjRvd/IS9JDz6HUT4Km31w2099lStDTMB BzuWLzFO4V9/CerQu6syKqUFH4xMudh2h5DDSf4QP1XQyP9dsOhcIgm3xZDmcX8M31Q5 FPMC0sBLK6KELkMiViLXjBzEoi1SLlEScfsID42QDGZZSAnPuCQQ26l8leRwDGhDbbuq hP81aM9wyGGMIEAF1n5gm1t+UEWTf1/lA1wLkHOzOmp7pERnvd5Vvhk2KD2eiNi+87j8 jhKy9KGEEfT5Zhq2IqcS8jPAVBGPulA8cCje0DUC6W3XBW5lDG3Kv3+kCP/sObTXaChB 6J9A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=/uaDbmcCn13OD0Ho/AwzHNYTMgWyU9YpyNJaWuRGLgM=; b=TRwgRvkE8IaSwis7WiREvw5NwN6Vkwzny5BxEhAMUE19P1leYBRvG6xzr/h9IHOoeK zkWjZ/KeHxbLfwKUvqbxBcgwqajhSI6G9RD2tRA5fMMrU+jTiBsSjruORaauOXnCfYju 13Q2oSROuTDoc9fDJpeY68NxBPdTyauEnUquJAAfVWUNhVmjhjkGYixNgBWTofk7ja5i uHfYbA4wjhim9qNzlmuJzhPinuG3b+yf9JuJA82GgRRI9W4ffjnI56VUHACGprKDFvda kf8tPcNIyMotjm5N29cSVchyI5DgNhTfc2vmgy0ZZb0v94TtE6s7Qf3UlFLzBalWFFzx knig== X-Gm-Message-State: APjAAAVldtKNxiO9pBZ0VqQ78BdJV+Npau/y/iyK9DvnOFIA1Mo+ChvG s03Lvr3PQOBHrUY0Djf6b3hKcUBGUGAVqlJythy0LTePFwbplw== X-Google-Smtp-Source: APXvYqx7nIm6j2a2PFbbITUmLfHbzjPH2ehfo0KDghN8yLDTb+qs7WbV2+agL9JeTxgOimRTLfFioZIG0ZTH3kbbvdg= X-Received: by 2002:adf:e449:: with SMTP id t9mr3715441wrm.196.1573058132011; Wed, 06 Nov 2019 08:35:32 -0800 (PST) MIME-Version: 1.0 From: Eugene Yudin Date: Wed, 6 Nov 2019 19:35:21 +0300 Message-ID: To: devel@uclibc-ng.org Subject: [uclibc-ng-devel] [PATCH] utils and enabled UCLIBC_BUILD_SSP X-BeenThere: devel@uclibc-ng.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: uClibc-ng Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: devel-bounces@uclibc-ng.org Sender: "devel" Hi Waldemar, When building with crosstool-ng, the libssp library is compiled at the final stage of the compiler (after uClibc-ng was built), resulting in the chicken-and-egg problem with utils. The attached patch fixes the problem by building utils without stack smashing protector. [ALL ] mipsel-ndms-linux-uclibc-gcc ../utils/getconf.c -o ../utils/getconf -Wall -Wstrict-prototypes -Wstrict-aliasing -Wno-nonnull-compare -funsigned-char -fno-builtin -fno-asm -fmerge-all-constants -msoft-float -std=gnu99 -mabi=32 -mnan=legacy -fstack-protector -nostdinc -I../include -I../include -include libc-symbols.h -I../libc/sysdeps/linux/mips -I../libc/sysdeps/linux -I../ldso/ldso/mips -I../ldso/include -I. -Os -fstrict-aliasing -mno-split-addresses -pipe -D__USE_STDIO_FUTEXES__ -DHAVE_FORCED_UNWIND -D_LIBC_REENTRANT -I../libpthread/nptl -I../libpthread/nptl -I../libpthread/nptl/sysdeps/unix/sysv/linux/mips -I../libpthread/nptl/sysdeps/mips -I../libpthread/nptl/sysdeps/mips -I../libpthread/nptl/sysdeps/unix/sysv/linux -I../libpthread/nptl/sysdeps/unix/sysv/linux -I../libpthread/nptl/sysdeps/pthread -I../libpthread/nptl/sysdeps/pthread/bits -I../libpthread/nptl/sysdeps/generic -I../libc/sysdeps/linux/common -isystem /home/eugene/Documents/work/cases/13220_toolchain/crosstool-ng/.build/mipsel-ndms-linux-uclibc/buildtools/lib/gcc/mipsel-ndms-linux-uclibc/8.1.0/include-fixed -isystem /home/eugene/Documents/work/cases/13220_toolchain/crosstool-ng/.build/mipsel-ndms-linux-uclibc/buildtools/lib/gcc/mipsel-ndms-linux-uclibc/8.1.0/include -I/home/eugene/x-tools/mipsel-ndms-linux-uclibc/mipsel-ndms-linux-uclibc/sysroot/usr/include/ -DNDEBUG -fstack-protector-all -I../ldso/ldso/mips -I../ldso/include -DUCLIBC_RUNTIME_PREFIX="/" -DUCLIBC_LDSO="ld-uClibc.so.1" -I..///home/eugene/x-tools/mipsel-ndms-linux-uclibc/mipsel-ndms-linux-uclibc/sysroot/usr/include/ -DNOT_IN_libc -B../lib -Wl,-rpath-link,../lib -fstack-protector-all -I../ldso/ldso/mips -I../ldso/include -DUCLIBC_RUNTIME_PREFIX="/" -DUCLIBC_LDSO="ld-uClibc.so.1" -I..///home/eugene/x-tools/mipsel-ndms-linux-uclibc/mipsel-ndms-linux-uclibc/sysroot/usr/include/ -DNOT_IN_libc -B../lib -Wl,-rpath-link,../lib -DGETCONF_DIR='"/home/eugene/Documents/work/cases/13220_toolchain/crosstool-ng/.build/mipsel-ndms-linux-uclibc/build/build-libc-final/multilib/utils"' -MT ../utils/getconf -MD -MP -MF ../utils/.getconf.dep [ALL ] ../utils/getconf.c: In function 'main': [ALL ] ../utils/getconf.c:1238:6: warning: statement will never be executed [-Wswitch-unreachable] [ALL ] { [ALL ] ^ [ALL ] /home/eugene/Documents/work/cases/13220_toolchain/crosstool-ng/.build/mipsel-ndms-linux-uclibc/buildtools/lib/gcc/mipsel-ndms-linux-uclibc/8.1.0/../../../../mipsel-ndms-linux-uclibc/bin/ld: cannot find -lssp_nonshared [ALL ] /home/eugene/Documents/work/cases/13220_toolchain/crosstool-ng/.build/mipsel-ndms-linux-uclibc/buildtools/lib/gcc/mipsel-ndms-linux-uclibc/8.1.0/../../../../mipsel-ndms-linux-uclibc/bin/ld: cannot find -lssp [ERROR] collect2: error: ld returned 1 exit status [ALL ] Makefile.in:114: recipe for target '../utils/getconf' failed commit 3b8a2dee02e3877f134c50edfc209d2c7cab195d Author: Eugene Yudin Date: Thu Aug 16 18:06:57 2018 +0300 Makefile.in: build utils without stack smashing protector [ALL ] mipsel-ndms-linux-uclibc-gcc ../utils/getconf.c -o ../utils/getconf -Wall -Wstrict-prototypes -Wstrict-aliasing -Wno-nonnull-compare -funsigned-char -fno-builtin -fno-asm -fmerge-all-constants -msoft-float -std=gnu99 -mabi=32 -mnan=legacy -fstack-protector -nostdinc -I../include -I../include -include libc-symbols.h -I../libc/sysdeps/linux/mips -I../libc/sysdeps/linux -I../ldso/ldso/mips -I../ldso/include -I. -Os -fstrict-aliasing -mno-split-addresses -pipe -D__USE_STDIO_FUTEXES__ -DHAVE_FORCED_UNWIND -D_LIBC_REENTRANT -I../libpthread/nptl -I../libpthread/nptl -I../libpthread/nptl/sysdeps/unix/sysv/linux/mips -I../libpthread/nptl/sysdeps/mips -I../libpthread/nptl/sysdeps/mips -I../libpthread/nptl/sysdeps/unix/sysv/linux -I../libpthread/nptl/sysdeps/unix/sysv/linux -I../libpthread/nptl/sysdeps/pthread -I../libpthread/nptl/sysdeps/pthread/bits -I../libpthread/nptl/sysdeps/generic -I../libc/sysdeps/linux/common -isystem /home/eugene/Documents/work/cases/13220_toolchain/crosstool-ng/.build/mipsel-ndms-linux-uclibc/buildtools/lib/gcc/mipsel-ndms-linux-uclibc/8.1.0/include-fixed -isystem /home/eugene/Documents/work/cases/13220_toolchain/crosstool-ng/.build/mipsel-ndms-linux-uclibc/buildtools/lib/gcc/mipsel-ndms-linux-uclibc/8.1.0/include -I/home/eugene/x-tools/mipsel-ndms-linux-uclibc/mipsel-ndms-linux-uclibc/sysroot/usr/include/ -DNDEBUG -fstack-protector-all -I../ldso/ldso/mips -I../ldso/include -DUCLIBC_RUNTIME_PREFIX="/" -DUCLIBC_LDSO="ld-uClibc.so.1" -I..///home/eugene/x-tools/mipsel-ndms-linux-uclibc/mipsel-ndms-linux-uclibc/sysroot/usr/include/ -DNOT_IN_libc -B../lib -Wl,-rpath-link,../lib -fstack-protector-all -I../ldso/ldso/mips -I../ldso/include -DUCLIBC_RUNTIME_PREFIX="/" -DUCLIBC_LDSO="ld-uClibc.so.1" -I..///home/eugene/x-tools/mipsel-ndms-linux-uclibc/mipsel-ndms-linux-uclibc/sysroot/usr/include/ -DNOT_IN_libc -B../lib -Wl,-rpath-link,../lib -DGETCONF_DIR='"/home/eugene/Documents/work/cases/13220_toolchain/crosstool-ng/.build/mipsel-ndms-linux-uclibc/build/build-libc-final/multilib/utils"' -MT ../utils/getconf -MD -MP -MF ../utils/.getconf.dep [ALL ] ../utils/getconf.c: In function 'main': [ALL ] ../utils/getconf.c:1238:6: warning: statement will never be executed [-Wswitch-unreachable] [ALL ] { [ALL ] ^ [ALL ] /home/eugene/Documents/work/cases/13220_toolchain/crosstool-ng/.build/mipsel-ndms-linux-uclibc/buildtools/lib/gcc/mipsel-ndms-linux-uclibc/8.1.0/../../../../mipsel-ndms-linux-uclibc/bin/ld: cannot find -lssp_nonshared [ALL ] /home/eugene/Documents/work/cases/13220_toolchain/crosstool-ng/.build/mipsel-ndms-linux-uclibc/buildtools/lib/gcc/mipsel-ndms-linux-uclibc/8.1.0/../../../../mipsel-ndms-linux-uclibc/bin/ld: cannot find -lssp [ERROR] collect2: error: ld returned 1 exit status [ALL ] Makefile.in:114: recipe for target '../utils/getconf' failed diff --git a/utils/Makefile.in b/utils/Makefile.in index 2f8d1c96a..1544c8fcc 100644 --- a/utils/Makefile.in +++ b/utils/Makefile.in @@ -9,7 +9,7 @@ subdirs += utils # "make utils" flags CFLAGS-utils := \ - $(SSP_ALL_CFLAGS) \ + $(SSP_DISABLE_FLAGS) \ -I$(top_srcdir)ldso/ldso/$(TARGET_ARCH) \ -I$(top_srcdir)ldso/include \ -DUCLIBC_RUNTIME_PREFIX=\"$(RUNTIME_PREFIX)\" \