[packages/dietlibc] handle absolute cc path during platform determination; rel 2

atler atler at pld-linux.org
Thu Feb 13 02:25:06 CET 2025


commit 47030aa6db169898f5a54e8b14a543f10fbeacd2
Author: Jan Palus <atler at pld-linux.org>
Date:   Thu Feb 13 00:31:35 2025 +0100

    handle absolute cc path during platform determination; rel 2

 absolute-cc-path.patch | 37 +++++++++++++++++++++++++++++++++++++
 dietlibc.spec          |  4 +++-
 2 files changed, 40 insertions(+), 1 deletion(-)
---
diff --git a/dietlibc.spec b/dietlibc.spec
index bebe100..c91c7cc 100644
--- a/dietlibc.spec
+++ b/dietlibc.spec
@@ -11,7 +11,7 @@ Summary(pl.UTF-8):	Biblioteka standardowa C zoptymalizowana na rozmiar
 Summary(pt_BR.UTF-8):	libc pequena otimizada para tamanho
 Name:		dietlibc
 Version:	0.34
-Release:	1
+Release:	2
 Epoch:		2
 License:	GPL v2
 Group:		Development/Libraries
@@ -31,6 +31,7 @@ Patch11:	%{name}-devmacros.patch
 Patch12:	%{name}-notify.patch
 Patch13:	x32-fixes.patch
 Patch14:	%{name}-no-vsyscall.patch
+Patch15:	absolute-cc-path.patch
 URL:		http://www.fefe.de/dietlibc/
 BuildRequires:	rpmbuild(macros) >= 2.005
 BuildRequires:	sed >= 4.0
@@ -115,6 +116,7 @@ statyczne.
 %patch -P12 -p1
 %patch -P13 -p1
 %patch -P14 -p1
+%patch -P15 -p1
 
 %if "%{cc_version}" < "3.4"
 %{__sed} -i -e '/CFLAGS/ s/-Wextra//' Makefile
diff --git a/absolute-cc-path.patch b/absolute-cc-path.patch
new file mode 100644
index 0000000..659052d
--- /dev/null
+++ b/absolute-cc-path.patch
@@ -0,0 +1,37 @@
+--- dietlibc-0.34/diet.c.orig	2025-02-12 23:57:45.183093416 +0100
++++ dietlibc-0.34/diet.c	2025-02-13 00:19:34.490119122 +0100
+@@ -139,18 +139,20 @@
+     char *tmp2,*tmp3;
+     if (tmp<cc) goto donttouch;
+     if (!strstr(cc,"cc") && !strstr(cc,"clang")) goto donttouch;
+-    if ((tmp2=strstr(cc,"linux-"))) {	/* cross compiling? */
++    char *basecc = strrchr(cc,'/');
++    basecc = basecc ? basecc + 1 : cc;
++    if ((tmp2=strstr(basecc,"linux-"))) {	/* cross compiling? */
+       int len=strlen(platform);
+       --tmp2;
+-      tmp3=strchr(cc,'-');
++      tmp3=strchr(basecc,'-');
+       if (tmp3<tmp2) tmp2=tmp3;
+-      if (tmp2-cc>90) error("platform name too long!\n");
++      if (tmp2-basecc>90) error("platform name too long!\n");
+       shortplatform=platform+len;
+ #if defined(__x86_64__) && defined (__ILP32__)
+       strcat(shortplatform,"x32");
+ #else
+-      memmove(shortplatform,argv[1],(size_t)(tmp2-cc));
+-      platform[tmp2-cc+len]=0;
++      memmove(shortplatform,basecc,(size_t)(tmp2-basecc));
++      platform[tmp2-basecc+len]=0;
+ #endif
+       if (shortplatform[0]=='i' && shortplatform[2]=='8' && shortplatform[3]=='6') shortplatform[1]='3';
+       else if (!strncmp(shortplatform, "pentium4", 8)) strcpy(shortplatform, "i386");
+@@ -175,7 +177,7 @@
+         strcpy(shortplatform, "parisc");
+       if (!strcmp(shortplatform, "mips64el"))
+         strcpy(shortplatform, "mips64");
+-      if (!strncmp(cc, "x86_64-linux-gnux32-", 20) || !strncmp(cc, "x86_64-pc-linux-gnux32-", 23))
++      if (!strncmp(basecc, "x86_64-linux-gnux32-", 20) || !strncmp(basecc, "x86_64-pc-linux-gnux32-", 23))
+         strcpy(shortplatform, "x32");
+     } else {
+ #ifdef __sparc__
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/dietlibc.git/commitdiff/47030aa6db169898f5a54e8b14a543f10fbeacd2



More information about the pld-cvs-commit mailing list