From patchwork Tue May 24 17:28:19 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Fabrice Fontaine X-Patchwork-Id: 1635123 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20210112 header.b=Hb2kBnm8; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=buildroot.org (client-ip=140.211.166.137; helo=smtp4.osuosl.org; envelope-from=buildroot-bounces@buildroot.org; receiver=) Received: from smtp4.osuosl.org (smtp4.osuosl.org [140.211.166.137]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4L71Sc6vdBz9sGS for ; Wed, 25 May 2022 03:30:56 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id 528CC41A08; Tue, 24 May 2022 17:30:54 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp4.osuosl.org ([127.0.0.1]) by localhost (smtp4.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 6nB45pRwCE6D; Tue, 24 May 2022 17:30:53 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by smtp4.osuosl.org (Postfix) with ESMTP id 0987941677; Tue, 24 May 2022 17:30:51 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from smtp1.osuosl.org (smtp1.osuosl.org [140.211.166.138]) by ash.osuosl.org (Postfix) with ESMTP id D71791BF3D5 for ; Tue, 24 May 2022 17:30:50 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp1.osuosl.org (Postfix) with ESMTP id BE53E84128 for ; Tue, 24 May 2022 17:30:50 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Authentication-Results: smtp1.osuosl.org (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com Received: from smtp1.osuosl.org ([127.0.0.1]) by localhost (smtp1.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 0VmBkPyPLMsL for ; Tue, 24 May 2022 17:30:49 +0000 (UTC) X-Greylist: whitelisted by SQLgrey-1.8.0 Received: from mail-wm1-x329.google.com (mail-wm1-x329.google.com [IPv6:2a00:1450:4864:20::329]) by smtp1.osuosl.org (Postfix) with ESMTPS id 6632D84125 for ; Tue, 24 May 2022 17:30:49 +0000 (UTC) Received: by mail-wm1-x329.google.com with SMTP id p19so2564531wmg.2 for ; Tue, 24 May 2022 10:30:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=Ps+AFn5tPVqUcjYzfcQ1E3L/v49sFOyK0l/bKRtN6HM=; b=Hb2kBnm8xQ1mp/Hmtx3lEzHtiCtd2qhf1XqCS97cyjw+Q3oE0AbYY0UOcfgzateXOy 3Qsj+EE1roVK7Pt69SNdGMtOdsnZxXoNJ/lsR4myJkTp7pV6L2EXuXT/eMUbGvdhApOc SPrwZsbiN2Y8TshbJjrO3LwoPMOlojNztbFbRHVCjPM57KzivoLdZIf8Z/E5xLAgGftV JqoD+FBfB33wypWeDCTG3rac8eK6tKzDf5FNNhfg7lzTl/KfFdh2zvvf5Dvx9KeEbikE QWnu7Y+ctcgvxSq6RWQdilQY5R6CwagSPa9e+D0dUGteAMQ8UfL6ELbCp+jyDIF8dw+Z ifog== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=Ps+AFn5tPVqUcjYzfcQ1E3L/v49sFOyK0l/bKRtN6HM=; b=JA7Rcq8f8jfEt+2/+BwoPYOMjjOJExgfpiV2+9uxMox17LRqnYLa7R1DHz1lV0Mm35 FFbpAYAUWnC0g/Tz2xpRSvDIqM85jI7konumoY07gfcDoeuOPbNvxOR/nXrsermU93Pj rKm3eHeCEooAfXsoceiI3LDsaerPuwaPU4QMYf8fcd9YtlUQVZzVUZNsuuODj9AV6nLM a1smmEQ4+pW4GibXr5DmBxnkSoIK415VWcjO9TNprq/bFdFZzqzRrIHiOgTVPyV7UTWf gVSWa3hWJvSw8F+97sh00Bx0nNmUqbt7/e/x4mao3znl+1HHaz2gVvvQFeQqwjO7rhEz YYmw== X-Gm-Message-State: AOAM531UfNFeHeaSPphmn8J8cfKUbu5m64jD1gszxKoOVHBzw+hGVmc3 rPbyW3yiMabg3CAkDDaAZTMKXgmz5p8= X-Google-Smtp-Source: ABdhPJymBakrIGy1qXHx1sgym3p9ZLan3hxdkCPszri7/FSf39s2+plFWy6aHNm1/lWRox+TYqswnw== X-Received: by 2002:a05:600c:601e:b0:397:5d88:648c with SMTP id az30-20020a05600c601e00b003975d88648cmr3353229wmb.122.1653413447203; Tue, 24 May 2022 10:30:47 -0700 (PDT) Received: from kali.home (2a01cb088e0b5b002be75de2a1caa253.ipv6.abo.wanadoo.fr. [2a01:cb08:8e0b:5b00:2be7:5de2:a1ca:a253]) by smtp.gmail.com with ESMTPSA id i15-20020a0560001acf00b0020d0c37b350sm81066wry.27.2022.05.24.10.30.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 May 2022 10:30:46 -0700 (PDT) From: Fabrice Fontaine To: buildroot@buildroot.org Date: Tue, 24 May 2022 19:28:19 +0200 Message-Id: <20220524172819.2361896-1-fontaine.fabrice@gmail.com> X-Mailer: git-send-email 2.35.1 MIME-Version: 1.0 Subject: [Buildroot] [PATCH 1/1] package/libfreeimage: fix musl build X-BeenThere: buildroot@buildroot.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?utf-8?b?UsOpbWkgUsOpcm9sbGU=?= , Fabrice Fontaine Errors-To: buildroot-bounces@buildroot.org Sender: "buildroot" Fix the following musl build failure: In file included from /nvmedata/autobuild/instance-12/output-1/per-package/libfreeimage/host/armeb-buildroot-linux-musleabi/sysroot/usr/include/pthread.h:31, from /nvmedata/autobuild/instance-12/output-1/per-package/libfreeimage/host/armeb-buildroot-linux-musleabi/include/c++/9.4.0/armeb-buildroot-linux-musleabi/bits/gthr-default.h:35, from /nvmedata/autobuild/instance-12/output-1/per-package/libfreeimage/host/armeb-buildroot-linux-musleabi/include/c++/9.4.0/armeb-buildroot-linux-musleabi/bits/gthr.h:148, from /nvmedata/autobuild/instance-12/output-1/per-package/libfreeimage/host/armeb-buildroot-linux-musleabi/include/c++/9.4.0/ext/atomicity.h:35, from /nvmedata/autobuild/instance-12/output-1/per-package/libfreeimage/host/armeb-buildroot-linux-musleabi/include/c++/9.4.0/bits/basic_string.h:39, from /nvmedata/autobuild/instance-12/output-1/per-package/libfreeimage/host/armeb-buildroot-linux-musleabi/include/c++/9.4.0/string:55, from Source/Utilities.h:44, from Source/FreeImage/PluginPSD.cpp:27: Source/FreeImage/PluginPSD.cpp: In function 'BOOL Save(FreeImageIO*, FIBITMAP*, fi_handle, int, int, void*)': Source/FreeImage/PluginPSD.cpp:130:10: error: cannot convert 'std::nullptr_t' to 'BOOL' {aka 'int'} in return 130 | return NULL; | ^~~~ Fixes: - http://autobuild.buildroot.org/results/f9c4ba83a506d374d8a28673aac619d8ff80f3da Signed-off-by: Fabrice Fontaine --- .../0004-fixed-C-11-warnings.patch | 94 +++++++++++++++++++ 1 file changed, 94 insertions(+) create mode 100644 package/libfreeimage/0004-fixed-C-11-warnings.patch diff --git a/package/libfreeimage/0004-fixed-C-11-warnings.patch b/package/libfreeimage/0004-fixed-C-11-warnings.patch new file mode 100644 index 0000000000..cf9c47303a --- /dev/null +++ b/package/libfreeimage/0004-fixed-C-11-warnings.patch @@ -0,0 +1,94 @@ +fixed C++11 warnings + +Signed-off-by: Fabrice Fontaine +[Retrieved from: https://sourceforge.net/p/freeimage/svn/1896] + +Index: trunk/Source/FreeImage/CacheFile.cpp +=================================================================== +--- trunk/Source/FreeImage/CacheFile.cpp (révision 1895) ++++ trunk/Source/FreeImage/CacheFile.cpp (révision 1896) +@@ -147,10 +147,14 @@ + m_current_block->data = new BYTE[BLOCK_SIZE]; + + fseek(m_file, m_current_block->nr * BLOCK_SIZE, SEEK_SET); +- fread(m_current_block->data, BLOCK_SIZE, 1, m_file); +- +- m_page_cache_mem.splice(m_page_cache_mem.begin(), m_page_cache_disk, it->second); +- m_page_map[nr] = m_page_cache_mem.begin(); ++ if (fread(m_current_block->data, BLOCK_SIZE, 1, m_file) == 1) { ++ m_page_cache_mem.splice(m_page_cache_mem.begin(), m_page_cache_disk, it->second); ++ m_page_map[nr] = m_page_cache_mem.begin(); ++ } ++ else { ++ FreeImage_OutputMessageProc(FIF_UNKNOWN, "Failed to lock a block in CacheFile"); ++ return NULL; ++ } + } + + // if the memory cache size is too large, swap an item to disc +Index: trunk/Source/FreeImage/MultiPage.cpp +=================================================================== +--- trunk/Source/FreeImage/MultiPage.cpp (révision 1895) ++++ trunk/Source/FreeImage/MultiPage.cpp (révision 1896) +@@ -271,8 +271,8 @@ + } + } + +- std::auto_ptr bitmap (new FIMULTIBITMAP); +- std::auto_ptr header (new MULTIBITMAPHEADER); ++ std::unique_ptr bitmap (new FIMULTIBITMAP); ++ std::unique_ptr header (new MULTIBITMAPHEADER); + header->m_filename = filename; + // io is default + header->node = node; +@@ -339,8 +339,8 @@ + PluginNode *node = list->FindNodeFromFIF(fif); + + if (node) { +- std::auto_ptr bitmap (new FIMULTIBITMAP); +- std::auto_ptr header (new MULTIBITMAPHEADER); ++ std::unique_ptr bitmap (new FIMULTIBITMAP); ++ std::unique_ptr header (new MULTIBITMAPHEADER); + header->io = *io; + header->node = node; + header->fif = fif; +Index: trunk/Source/FreeImage/PSDParser.cpp +=================================================================== +--- trunk/Source/FreeImage/PSDParser.cpp (révision 1895) ++++ trunk/Source/FreeImage/PSDParser.cpp (révision 1896) +@@ -97,7 +97,7 @@ + template + class PSDGetValue { + public: +- static inline int get(const BYTE * iprBuffer) {} // error ++ static inline int get(const BYTE * iprBuffer) { return -1; } // error + }; + + template <> +Index: trunk/Source/FreeImage/PluginPSD.cpp +=================================================================== +--- trunk/Source/FreeImage/PluginPSD.cpp (révision 1895) ++++ trunk/Source/FreeImage/PluginPSD.cpp (révision 1896) +@@ -127,7 +127,7 @@ + static BOOL DLL_CALLCONV + Save(FreeImageIO *io, FIBITMAP *dib, fi_handle handle, int page, int flags, void *data) { + if(!handle) { +- return NULL; ++ return FALSE; + } + try { + psdParser parser; +Index: trunk/Source/FreeImage/PluginHDR.cpp +=================================================================== +--- trunk/Source/FreeImage/PluginHDR.cpp (révision 1895) ++++ trunk/Source/FreeImage/PluginHDR.cpp (révision 1896) +@@ -244,7 +244,8 @@ + } + else if((buf[0] == '#') && (buf[1] == 0x20)) { + header_info->valid |= RGBE_VALID_COMMENT; +- strcpy(header_info->comment, buf); ++ strncpy(header_info->comment, buf, HDR_MAXLINE - 1); ++ header_info->comment[HDR_MAXLINE - 1] = '\0'; + } + } + if(!bHeaderFound || !bFormatFound) {