From patchwork Sat Sep 16 03:55:36 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chukun Pan X-Patchwork-Id: 1835395 X-Patchwork-Delegate: hauke@hauke-m.de Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=IhwU0vht; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.openwrt.org (client-ip=2607:7c80:54:3::133; helo=bombadil.infradead.org; envelope-from=openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org; receiver=patchwork.ozlabs.org) Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4RnclP5W80z1yfd for ; Sat, 16 Sep 2023 13:59:59 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=if4kJQIcnEdcN20qkgOh9uDDB7GZfVcgflOlDWpBQHY=; b=IhwU0vhtIWpwg4 VCHkiu7PqKodXAId44qBAsJ1xdYNW6Dq7DhvzDUxYyhsFgU1ykATs1shCCnBJX8hNGfiCtOjUwCz5 Eqkk84wPwLyHaL+M9jeIT8N9U6Meghu8YEnL0f67HYObzQ7ENWzBbrjTFMr/ijh5PQaqGX60MdfbJ Nt3eC9FPdn/vMDzdsE+hdiTTI8ZU4YjL5EHZVkqSO7CxxydGxEXoG/roaVv4eLmaziaNxrynCvI0q SY9IL8i90hcf0Rwf08pszvzpadd5kDIVy0SmAiVsVSdvJJxjXr9QN5yblOH9mA9Eh5H7dPZYVNJp2 qKYqZN8GsVAz0y0GSRLQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qhMPU-00BrOI-2k; Sat, 16 Sep 2023 03:55:56 +0000 Received: from mail-m49198.qiye.163.com ([45.254.49.198]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qhMPP-00BrNF-0t for openwrt-devel@lists.openwrt.org; Sat, 16 Sep 2023 03:55:54 +0000 Received: from Vostro-3710.lan (unknown [IPV6:240e:3b3:2c03:8a0:17d7:cd6:8de:a2c6]) by mail-m121145.qiye.163.com (Hmail) with ESMTPA id 5599C800067; Sat, 16 Sep 2023 11:55:40 +0800 (CST) From: Chukun Pan To: openwrt-devel@lists.openwrt.org Cc: =?utf-8?b?UmFmYcWCIE1pxYJlY2tp?= , Chukun Pan Subject: [PATCH] urngd: fixes compilation with glibc Date: Sat, 16 Sep 2023 11:55:36 +0800 Message-Id: <20230916035536.354586-1-amadeus@jmu.edu.cn> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-HM-Spam-Status: e1kfGhgUHx5ZQUpXWQgPGg8OCBgUHx5ZQUlOS1dZFg8aDwILHllBWSg2Ly tZV1koWUFITzdXWS1ZQUlXWQ8JGhUIEh9ZQVlCSENJVh4fQxhDGBofTEoeTFUTARMWGhIXJBQOD1 lXWRgSC1lBWUlPSx5BSBlIQUkYS0hBQxpLQUpMH0xBGB9NQUMfHkEaSRhNWVdZFhoPEhUdFFlBWU 9LSFVKSktISkNVSktLVUtZBg++ X-HM-Tid: 0a8a9c21441ab03akuuu5599c800067 X-HM-MType: 10 X-HM-Sender-Digest: e1kMHhlZQR0aFwgeV1kSHx4VD1lBWUc6NCo6PRw4SD1OTlErPAEjHhEC NwIKFD5VSlVKTUJPQ0hNTk9LQ0lPVTMWGhIXVRoWGh8eDgg7ERYOVR4fDlUYFUVZV1kSC1lBWUlP Sx5BSBlIQUkYS0hBQxpLQUpMH0xBGB9NQUMfHkEaSRhNWVdZCAFZQUpMSUw3Bg++ X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230915_205551_532008_035BD37B X-CRM114-Status: UNSURE ( 5.03 ) X-CRM114-Notice: Please train this message. X-Spam-Score: 0.0 (/) X-Spam-Report: Spam detection software, running on the system "bombadil.infradead.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: When compiling with glibc it will result in error: 1. #warning _FORTIFY_SOURCE requires compiling with optimization (-O) [-Werror=cpp] Fix this by compiling with optimization (-O2) by default. 2. jitterentropy-base.c:(.text+0x39f8): undefined reference to `pthread_join' Fix this by always linking pthread. Content analysis details: (0.0 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record X-BeenThere: openwrt-devel@lists.openwrt.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: OpenWrt Development List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "openwrt-devel" Errors-To: openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org When compiling with glibc it will result in error: 1. #warning _FORTIFY_SOURCE requires compiling with optimization (-O) [-Werror=cpp] Fix this by compiling with optimization (-O2) by default. 2. jitterentropy-base.c:(.text+0x39f8): undefined reference to `pthread_join' Fix this by always linking pthread. Signed-off-by: Chukun Pan --- CMakeLists.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index a1ee0c1..20f4774 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -23,7 +23,8 @@ ADD_EXECUTABLE(urngd TARGET_LINK_LIBRARIES(urngd ${ubox}) # jitter RNG must not be compiled with optimizations -SET_SOURCE_FILES_PROPERTIES(${JTEN_DIR}/jitterentropy-base.c PROPERTIES COMPILE_FLAGS -O0) +SET_SOURCE_FILES_PROPERTIES(${JTEN_DIR}/jitterentropy-base.c PROPERTIES COMPILE_FLAGS -O2) +TARGET_LINK_LIBRARIES(urngd pthread) INSTALL(TARGETS urngd RUNTIME DESTINATION ${CMAKE_INSTALL_SBINDIR})