Source: prads
Version: 0.3.3-7
Severity: serious
Tags: ftbfs patch
Justification: fails to build from source (but built successfully in the past)
X-Debbugs-Cc: i...@hack3r.moe

Dear maintainer,

prads failed to build on riscv64 due to undefined reference to `_res_opcodes',
which somehow not existent on riscv64 but on other platforms:

```
cc -g -O2 -ffile-prefix-map=/<<PKGBUILDDIR>>=. -fstack-protector-strong 
-Wformat -Werror=format-security -O3 -DCONFDIR='"/etc/prads/"' -D__USE_GNU -o 
shm-client shm-client.o -Wl,-z,relro -lpcap -lpcre -lresolv
/usr/bin/ld: dump_dns.o: in function `dump_dns':
./src/dump_dns.c:135: undefined reference to `_res_opcodes'
collect2: error: ld returned 1 exit status
make[3]: *** [Makefile:88: prads] Error 1
```

Full buildd log: 
https://buildd.debian.org/status/fetch.php?pkg=prads&arch=riscv64&ver=0.3.3-7&stamp=1634546939&raw=0

After some searching I found this related to libresolv. Using existing shim code
for FreeBSD I am able to fix FTBFS, which is included in the attached
patch.

If more help is needed, please let me know.

Cheers,
Eric
--- prads-0.3.3.orig/src/dump_dns.c
+++ prads-0.3.3/src/dump_dns.c
@@ -98,7 +98,7 @@ void printchars(char buf[NS_MAXDNAME], u
        (cp) += INT32SZ; \
 } while (0)

-#ifdef __FreeBSD__
+#if defined(__FreeBSD__) || defined(__riscv)
 const char *_res_opcodes[] = {
         "QUERY",
         "IQUERY",

Reply via email to