Bug#1065084: libelfin fails autopkg test with LLVM 18

2024-04-10 Thread Simon Chopin
Source: libelfin
Followup-For: Bug #1065084
X-Debbugs-Cc: scho...@ubuntu.com

I've applied the attached debdiff in Ubuntu to fix the issue, as it
prevents llvm-defaults from migrating.

-- System Information:
Debian Release: trixie/sid
  APT prefers noble
  APT policy: (500, 'noble'), (100, 'noble-proposed')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 6.8.0-22-generic (SMP w/8 CPU threads; PREEMPT)
Kernel taint flags: TAINT_PROPRIETARY_MODULE, TAINT_USER, TAINT_OOT_MODULE
Locale: LANG=fr_FR.UTF-8, LC_CTYPE=fr_FR.UTF-8 (charmap=UTF-8), LANGUAGE not set
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled
diff -Nru libelfin-0.3/debian/changelog libelfin-0.3/debian/changelog
--- libelfin-0.3/debian/changelog   2024-04-01 06:44:16.0 +0200
+++ libelfin-0.3/debian/changelog   2024-04-10 11:33:31.0 +0200
@@ -1,3 +1,9 @@
+libelfin (0.3-3.1ubuntu1) noble; urgency=medium
+
+  * Fix autopkgtests against newer clang (Closes: 1065084, LP: #2060786)
+
+ -- Simon Chopin   Wed, 10 Apr 2024 11:33:31 +0200
+
 libelfin (0.3-3.1build1) noble; urgency=medium
 
   * No-change rebuild for CVE-2024-3094
diff -Nru 
libelfin-0.3/debian/patches/0003-don-t-use-a-VLA-just-to-compute-a-buffer-size.patch
 
libelfin-0.3/debian/patches/0003-don-t-use-a-VLA-just-to-compute-a-buffer-size.patch
--- 
libelfin-0.3/debian/patches/0003-don-t-use-a-VLA-just-to-compute-a-buffer-size.patch
1970-01-01 01:00:00.0 +0100
+++ 
libelfin-0.3/debian/patches/0003-don-t-use-a-VLA-just-to-compute-a-buffer-size.patch
2024-04-10 11:33:31.0 +0200
@@ -0,0 +1,26 @@
+From: Simon Chopin 
+Date: Wed, 10 Apr 2024 11:25:19 +0200
+Subject: don't use a VLA just to compute a buffer size
+
+VLAs in C++ are compiler extensions, and clang will complain about it.
+
+Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/libelfin/+bug/2060786
+Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1065084
+Forwarded: https://github.com/aclements/libelfin/pull/82
+---
+ dwarf/small_vector.hh | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/dwarf/small_vector.hh b/dwarf/small_vector.hh
+index e73ab60..9437328 100644
+--- a/dwarf/small_vector.hh
 b/dwarf/small_vector.hh
+@@ -93,7 +93,7 @@ public:
+ while (target < n)
+ target <<= 1;
+ 
+-char *newbuf = new char[sizeof(T[target])];
++char *newbuf = new char[target * sizeof(T)];
+ T *src = base, *dest = (T*)newbuf;
+ for (; src < end; src++, dest++) {
+ new(dest) T(*src);
diff -Nru libelfin-0.3/debian/patches/series libelfin-0.3/debian/patches/series
--- libelfin-0.3/debian/patches/series  2023-02-13 21:57:02.0 +0100
+++ libelfin-0.3/debian/patches/series  2024-04-10 11:33:31.0 +0200
@@ -1,2 +1,3 @@
 0001-Let-d-rules-override-library-version.patch
 0002-Remove-const-qualifier-from-setter.patch
+0003-don-t-use-a-VLA-just-to-compute-a-buffer-size.patch


Bug#1065084: libelfin fails autopkg test with LLVM 18

2024-02-29 Thread Matthias Klose

Package: src:libelfin
Version: 0.3-3.1
Severity: important
Tags: sid trixie
User: pkg-llvm-t...@lists.alioth.debian.org
Usertags: llvm-18

libelfin fails autopkg test with LLVM 18:

[...]
194s autopkgtest [11:48:56]: test test-build-libdwarf++: 
[---

194s Output from pkg-config --cflags libdwarf++:
194s -I/usr/include/libelfin
194s success: pkg-config call succeeded
194s success: Compilation with cc and c++ produced x.o
194s success: Linking with c++ produced x
194s In file included from x.cpp:1:
194s In file included from /usr/include/libelfin/dwarf/dwarf++.hh:14:
194s /usr/include/libelfin/dwarf/small_vector.hh:96:50: warning: 
variable length arrays in C++ are a Clang extension [-Wvla-cxx-extension]

194s96 | char *newbuf = new char[sizeof(T[target])];
194s   |  ^~
194s /usr/include/libelfin/dwarf/small_vector.hh:96:50: note: read of 
non-const variable 'target' is not allowed in a constant expression

194s /usr/include/libelfin/dwarf/small_vector.hh:90:27: note: declared here
194s90 | size_type target = cap - base;
194s   |   ^
194s /usr/include/libelfin/dwarf/small_vector.hh:96:50: warning: 
variable length arrays in C++ are a Clang extension [-Wvla-cxx-extension]

194s96 | char *newbuf = new char[sizeof(T[target])];
194s   |  ^~
194s /usr/include/libelfin/dwarf/small_vector.hh:96:50: note: read of 
non-const variable 'target' is not allowed in a constant expression

194s /usr/include/libelfin/dwarf/small_vector.hh:90:27: note: declared here
194s90 | size_type target = cap - base;
194s   |   ^
195s /usr/include/libelfin/dwarf/small_vector.hh:96:50: warning: 
variable length arrays in C++ are a Clang extension [-Wvla-cxx-extension]

195s96 | char *newbuf = new char[sizeof(T[target])];
195s   |  ^~
195s /usr/include/libelfin/dwarf/small_vector.hh:68:17: note: in 
instantiation of member function 'dwarf::small_vector6>::reserve' requested here

195s68 | reserve(osize);
195s   | ^
195s /usr/include/libelfin/dwarf/small_vector.hh:43:31: note: in 
instantiation of member function 'dwarf::small_vector6>::operator=' requested here

195s43 | *this = o;
195s   |   ^
195s /usr/include/libelfin/dwarf/dwarf++.hh:344:9: note: in 
instantiation of member function 'dwarf::small_vector6>::small_vector' requested here

195s   344 | die(die &) = default;
195s   | ^
195s /usr/include/libelfin/dwarf/small_vector.hh:96:50: note: read of 
non-const variable 'target' is not allowed in a constant expression

195s96 | char *newbuf = new char[sizeof(T[target])];
195s   |  ^
195s /usr/include/libelfin/dwarf/small_vector.hh:90:27: note: declared here
195s90 | size_type target = cap - base;
195s   |   ^
195s 3 warnings generated.
195s success: Compilation with clang and clang++ produced x.o
195s success: Linking with clang++ produced x
195s info: test exiting
195s autopkgtest [11:48:57]: test test-build-libdwarf++: 
---]

195s test-build-libdwarf++ FAIL stderr: In file included from x.cpp:1: