From patchwork Sat May 11 18:13:52 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dario Binacchi X-Patchwork-Id: 3089 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-ed1-f72.google.com (mail-ed1-f72.google.com [209.85.208.72]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id F20E33F353 for ; Sat, 11 May 2024 20:14:02 +0200 (CEST) Received: by mail-ed1-f72.google.com with SMTP id 4fb4d7f45d1cf-5729ec37366sf1564733a12.0 for ; Sat, 11 May 2024 11:14:02 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715451242; cv=pass; d=google.com; s=arc-20160816; b=Soge0PdnKYtIuyxLHoJQlBKpKrJTQsGHMTc5vzT33FcL1d1CUS7gpjgdGUndXhNnmp J0A03Rj0PsGWZraYSWrLWCXGIFagTGNLpn8Crl/8ZsYdk3a0XYOukc1MyI17RHEKjHSd dymLzRJuPGKXy0Ujtm+FVxrhiziDGXQLmH4qOwOpzh3sp6GIZjyIckk3x+yi/ATHbe/1 IvUVSplDFDN3dfpj4H0HOQf0JBExZAeASL9x3JBUvuqhLFwCDCbZyc+vDKuDSW+GrM9N Rb7qw/qK+NDapT0PPmCNsoVPP9bZFPz+uetOWE57HlMNb1Cfp5HsPclFlZ/iDjKEgmQu swvA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=a2UCWstGCgf/IffMqmXI3u6jE6m/86KLSuH3NGHjvOo=; fh=f6KPMPGrPVvLyIBKZ+wbWQQIDQjzt7IMijr6vMb68VM=; b=Ij65RBOCpRsrt6VsXG+z1KZ0+OdaA3LMv3zk31dncLSi2wUae/UafvUYKvnMFqIifu p1+IfPlCaa12rdW5TMzthsMu9gIj+PERZMhsajzYz6C7jROZxvunCMeXyqmEoqgjrpc+ h7/SHyLJwsUo9cgKXwYjEetAOQ3tAfKO+XGQaIq3bRqnKBdtvB2VGKuuZhjQruKoIKbN vhGJ1a0ivykBEqW0tjvb6QhcKiRJTZLlqQ8lRZ7bBVy1bb/EakBKeqHa3JtGeNZyuL5f 51m0RWM4R7vZpy9q0/wXzlvXkUisCEyCuKK+ML4fXvj7oJuoZe4aT3bZupWa8n0P234W 3bUA==; darn=patchwork.amarulasolutions.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=GsAzds3h; spf=pass (google.com: domain of dario.binacchi@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=dario.binacchi@amarulasolutions.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; t=1715451242; x=1716056042; darn=patchwork.amarulasolutions.com; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:x-original-authentication-results :x-original-sender:content-transfer-encoding:mime-version:message-id :date:subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to; bh=a2UCWstGCgf/IffMqmXI3u6jE6m/86KLSuH3NGHjvOo=; b=WCPZLNSbEOYjC9ibstFKFKweNKzpJ+a0mG7nvcPKpcLdCj5Yrp//7dBHw+C4GzTcqL 3BYQXeHQg550CmUg/rVaEwgF7ru2szckQIAcfXMeH8Ay/0Qc3R6ku8Wnz9l//K9Gz8YI pUEloe5GMmSJUgGhRj8UiIMGMIWBdAaJ/APNs= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715451242; x=1716056042; h=list-unsubscribe:list-archive:list-help:list-post :x-spam-checked-in-group:list-id:mailing-list:precedence :x-original-authentication-results:x-original-sender :content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-beenthere:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=a2UCWstGCgf/IffMqmXI3u6jE6m/86KLSuH3NGHjvOo=; b=G+rEP01rr3gftLYRF4J1hWa5/RDT2ktOe6e67+lRXUXM4GdU92iy+TtKnzWUyLWEDW Vfel/QU74r9+FmnztlW3n6LONYJBQ06zK6sjZLvXsYs7EEYkx/HfrMCK6EPVUMvk52wX iC+CPpTWEyyfiJJnKBu9Vy02hDbnXqeiB6xnF5hf7L4mgXubqZlNs/wbHT+VqDGB0pgL JARMyI6kSmYrD9JDwNoYq5hkduLJpR4aWTrPqNrki7xggPZg/OJbV0uRsnQFsyq8F9iF xAcyHM93x4VvObBqYbHVl7D3VbHxwwg4xZqT2G0cxKDf9xC2yDSE9bMLGo0JJCZHjFlk cRkg== X-Forwarded-Encrypted: i=2; AJvYcCVw22Qj3PnS75AefsZfmLC6cZBdXyuaxc4U331bUXjkWmuY8y5AsYXEEohqattIgYbmkgN6ke+/JYH41HULrAyA0Bzp/FqfOUgbOHeBZ2dDQR2SZKqt18AxaCoHJw== X-Gm-Message-State: AOJu0YzXA7iBwMsfHg9SBle0JqvIstE/uFLrCq+oEzAQC8yR/5yafRm1 BPMqfGewgUwmfE9OyC4Lvw2y4kK06c79bujflv3D0i7f6uTSa+j0UGgyAFUKCNZYDTJmRCACcQ= = X-Google-Smtp-Source: AGHT+IHJyBDgIglKdx34F++p1X44KYtwccAkK6Y1uQfoGpl+tJMq6rgdWeLhfFCMOImo+83SEaW9Kg== X-Received: by 2002:a50:d653:0:b0:572:7d75:a715 with SMTP id 4fb4d7f45d1cf-5734d6b4120mr3825928a12.28.1715451242275; Sat, 11 May 2024 11:14:02 -0700 (PDT) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a05:6402:4581:b0:572:5cf0:971c with SMTP id 4fb4d7f45d1cf-573332f15e6ls394613a12.1.-pod-prod-04-eu; Sat, 11 May 2024 11:14:01 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCUwxBI5qjiwK7UsM4bpsCJRbnGVnpAjzT3IPUkpEVBYTBVJt4IHmOO/2UGQpKxeHqqExjFt7Z2WAQiyRJT01+LBM/U525VhIulZqBPR+mlVYloG X-Received: by 2002:a17:906:799:b0:a59:766b:d88 with SMTP id a640c23a62f3a-a5a2d5cca04mr367894266b.36.1715451240613; Sat, 11 May 2024 11:14:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1715451240; cv=none; d=google.com; s=arc-20160816; b=c8nx6UQ00bcNJhE4LdO953psJ3VZ5pAagHaTHI7pRd9j1KkwQY5wldwh0hCGhob70m i8EXAFZOyrR8bDLVoK3MFy7lDvfv1leQB+p6q1VdW5OGc8UIpur3oBaSTHwh8LYeeUz0 Us97odRkUfsIeN2Sm+CRQHa5tjLA+7wqp4GlAVAIFrKeSL6PPeQe1QJgFbfKV+GeKh83 V+iIgLekcX0OpJPTJMtI5WjjHdG/1YsEXW7taHcx5kuqOtDO/EiA4mj9gWo9/TuDEayb /Zte9YKeVJ7gjP69stCv81SnemBXtI9EM3Ue60gyqyY8U4O+tOTUGapMfudLnWF16Azu okPg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:dkim-signature; bh=7HMbvvaDYgLYoIvOKCbOI1jSKqpvev0EzKixGlJ6KEY=; fh=q01EF5EoQ+K+zHXLJ229a3alDetyMsEdjES4L1WH/hk=; b=pUvGTofcaW1QxI/hUgj+4TU9wrzpAvNvP++55hJYB4dArrCLn80471UVQGE0PmJ8LK VO0ryawfsEV1HPZdZht3KRkA/Rzvhry5G60n4tMwQrygGGbzZKzyOtc5+6wMDkMU/CuP /3nxeQoKKaNaJyaldOetbcb8/ypO2JlXh6y0jv+uwp9eSPd+qoViEs3r3lZGay0TkiyS 8m7FFuBDsTnOWYkPUtKC5m8MfumfFf6DDDyWBGQzjlax+ipsnm+ZKM+c0fOfVL7bV97L 3MpEeFyP5bCbW9TFR0Tb+uYdWqffimTl2d1UDJlOSFXkIm5bLvjoIteuTB0cbhDPKZam Arww==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=GsAzds3h; spf=pass (google.com: domain of dario.binacchi@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=dario.binacchi@amarulasolutions.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com Received: from mail-sor-f41.google.com (mail-sor-f41.google.com. [209.85.220.41]) by mx.google.com with SMTPS id a640c23a62f3a-a5a178bf485sor173418966b.7.2024.05.11.11.14.00 for (Google Transport Security); Sat, 11 May 2024 11:14:00 -0700 (PDT) Received-SPF: pass (google.com: domain of dario.binacchi@amarulasolutions.com designates 209.85.220.41 as permitted sender) client-ip=209.85.220.41; X-Forwarded-Encrypted: i=1; AJvYcCV0ojKGhUp7I04uBf6tFgul2yv/VUkl1yz4WrYU5EqBaX2u/jCQUfi+ofHah5pdKkkTEcyAIWdbDfV7aN79I6AHy7cy3QVGZrB43SO5J0nUKT0k X-Received: by 2002:a17:906:31c9:b0:a59:efd0:e884 with SMTP id a640c23a62f3a-a5a2d57a38dmr364816666b.27.1715451240182; Sat, 11 May 2024 11:14:00 -0700 (PDT) Received: from dario-ThinkPad-T14s-Gen-2i.homenet.telecomitalia.it (host-87-8-99-67.retail.telecomitalia.it. [87.8.99.67]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a5a178a9d73sm356146466b.67.2024.05.11.11.13.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 11 May 2024 11:13:59 -0700 (PDT) From: Dario Binacchi To: buildroot@buildroot.org Cc: Dario Binacchi , linux-amarula@amarulasolutions.com, michael@amarulasolutions.com Subject: [PATCH 1/1] package/sscep: fix linking error with musl-libc Date: Sat, 11 May 2024 20:13:52 +0200 Message-ID: <20240511181352.1712489-1-dario.binacchi@amarulasolutions.com> X-Mailer: git-send-email 2.43.0 MIME-Version: 1.0 X-Original-Sender: dario.binacchi@amarulasolutions.com X-Original-Authentication-Results: mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=GsAzds3h; spf=pass (google.com: domain of dario.binacchi@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=dario.binacchi@amarulasolutions.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com Content-Type: text/plain; charset="UTF-8" Precedence: list Mailing-list: list linux-amarula@amarulasolutions.com; contact linux-amarula+owners@amarulasolutions.com List-ID: X-Spam-Checked-In-Group: linux-amarula@amarulasolutions.com X-Google-Group-Id: 476853432473 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , The patch fixes the following linking failure: /home/buildroot/instance-0/output-1/host/opt/ext-toolchain/bin/../lib/gcc/i586-buildroot-linux-musl/9.3.0/../../../../i586-buildroot-linux-musl/bin/ld: /home/buildroot/instance-0/output-1/host/i586-buildroot-linux-musl/sysroot/lib/libc.a(getopt.o): in function `getopt': getopt.c:(.text.getopt+0x0): multiple definition of `getopt'; src/getopt.o:getopt.c:(.text+0x0): first defined here /home/buildroot/instance-0/output-1/host/opt/ext-toolchain/bin/../lib/gcc/i586-buildroot-linux-musl/9.3.0/../../../../i586-buildroot-linux-musl/bin/ld: /home/buildroot/instance-0/output-1/host/i586-buildroot-linux-musl/sysroot/lib/libc.a(getopt.o):(.data.optind+0x0): multiple definition of `optind'; src/getopt.o:(.data+0x0): first defined here Fixes: - http://autobuild.buildroot.net/results/d5b1b4e5e9d9c8eca5e75c345db4d1f3f0cd84ed Signed-off-by: Dario Binacchi --- ...-getopt-linking-error-with-musl-libc.patch | 67 +++++++++++++++++++ 1 file changed, 67 insertions(+) create mode 100644 package/sscep/0002-Fix-getopt-linking-error-with-musl-libc.patch diff --git a/package/sscep/0002-Fix-getopt-linking-error-with-musl-libc.patch b/package/sscep/0002-Fix-getopt-linking-error-with-musl-libc.patch new file mode 100644 index 000000000000..ebb9985ef3ee --- /dev/null +++ b/package/sscep/0002-Fix-getopt-linking-error-with-musl-libc.patch @@ -0,0 +1,67 @@ +From db7fab775d03438b4cfce6b49fab2d3176ecb1d3 Mon Sep 17 00:00:00 2001 +From: Dario Binacchi +Date: Sat, 11 May 2024 19:38:01 +0200 +Subject: [PATCH] Fix getopt linking error with musl-libc + +The buildroot project, to which the sscep application was added, has +configurations that raise the following linking error: +buildroot/output/host/opt/ext-toolchain/bin/../lib/gcc/i586-buildroot-linux-musl/9.3.0/../../../../i586-buildroot-linux-musl/bin/ld: buildroot/output/host/i586-buildroot-linux-musl/sysroot/lib/libc.a(getopt.o): in function `getopt': +getopt.c:(.text.getopt+0x0): multiple definition of `getopt'; src/getopt.o:getopt.c:(.text+0x0): first defined here +buildroot/output/host/opt/ext-toolchain/bin/../lib/gcc/i586-buildroot-linux-musl/9.3.0/../../../../i586-buildroot-linux-musl/bin/ld: buildroot/output/host/i586-buildroot-linux-musl/sysroot/lib/libc.a(getopt.o):(.data.optind+0x0): multiple definition of `optind'; src/getopt.o:(.data+0x0): first defined here +collect2: error: ld returned 1 exit status + +The commit 65561b53344b8 ("Fix getopt linking error") actually fixed the +linking error only for uclibc, but not for musl-libc. The patch fixes +the error for both uclibc and musl-libc. + +Link: http://autobuild.buildroot.net/results/d5b1b4e5e9d9c8eca5e75c345db4d1f3f0cd84ed/build-end.log +Signed-off-by: Dario Binacchi +Upstream: https://github.com/certnanny/sscep/pull/181 +--- + configure.ac | 2 +- + src/getopt.c | 12 ++---------- + 2 files changed, 3 insertions(+), 11 deletions(-) + +diff --git a/configure.ac b/configure.ac +index 9f3ee15686a2..7a968d97dcaa 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -34,7 +34,7 @@ AC_TYPE_SIZE_T + # Checks for library functions. + AC_FUNC_MALLOC + AC_FUNC_REALLOC +-AC_CHECK_FUNCS([alarm gethostbyname memset socket strchr strdup strstr]) ++AC_CHECK_FUNCS([alarm gethostbyname getopt memset socket strchr strdup strstr]) + + AC_CONFIG_FILES([Makefile]) + AC_SUBST([LIBTOOL_DEPS]) +diff --git a/src/getopt.c b/src/getopt.c +index 0109406ba4ac..8793052845ed 100644 +--- a/src/getopt.c ++++ b/src/getopt.c +@@ -31,15 +31,7 @@ + #include + #include + +-#define GETOPT_INTERFACE_VERSION 2 +-#if !defined _LIBC && defined __GLIBC__ && __GLIBC__ >= 2 +-# include +-# if _GNU_GETOPT_INTERFACE_VERSION == GETOPT_INTERFACE_VERSION +-# define ELIDE_CODE +-# endif +-#endif +- +-#ifndef ELIDE_CODE ++#ifndef HAVE_GETOPT + + char* optarg; + int optopt; +@@ -237,4 +229,4 @@ int getopt_long(int argc, char* const argv[], const char* optstring, + return retval; + } + +-#endif /* Not ELIDE_CODE. */ ++#endif /* HAVE_GETOPT */ +-- +2.43.0 +