FS#55108 - [dietlibc] compilation fails on i386

Attached to Project: Community Packages
Opened by Andreas Baumann (andreas_baumann) - Friday, 11 August 2017, 14:43 GMT
Last edited by Eli Schwartz (eschwartz) - Monday, 01 January 2018, 03:23 GMT
Task Type Bug Report
Category Packages
Status Closed
Assigned To Sergej Pupykin (sergej)
Architecture All
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Description:

results in:
bin-i386/diet gcc -D__dietlibc__ -pipe -nostdinc -O2 -pipe -fomit-frame-pointer -W -Wall -Wextra -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -Wno-switch -Wno-unused -Wredundant-decls -o bin-i386/dnsd contrib/dnsd.c
/tmp/cc8K45Ws.o: In function `init_sockets':
dnsd.c:(.text+0xc4): undefined reference to `socket'
dnsd.c:(.text+0xd4): undefined reference to `socket'
dnsd.c:(.text+0x13a): undefined reference to `setsockopt'
dnsd.c:(.text+0x16c): undefined reference to `bind'
dnsd.c:(.text+0x1b4): undefined reference to `setsockopt'
dnsd.c:(.text+0x1cc): undefined reference to `setsockopt'
dnsd.c:(.text+0x1f7): undefined reference to `setsockopt'
dnsd.c:(.text+0x20a): undefined reference to `setsockopt'
dnsd.c:(.text+0x230): undefined reference to `setsockopt'
/tmp/cc8K45Ws.o:dnsd.c:(.text+0x256): more undefined references to `setsockopt' follow
/tmp/cc8K45Ws.o: In function `init_sockets':
dnsd.c:(.text+0x2d2): undefined reference to `bind'
dnsd.c:(.text+0x30f): undefined reference to `setsockopt'
dnsd.c:(.text+0x348): undefined reference to `bind'
/tmp/cc8K45Ws.o: In function `handle.constprop.2':
dnsd.c:(.text+0x83e): undefined reference to `sendto'
dnsd.c:(.text+0x97c): undefined reference to `socket'
/tmp/cc8K45Ws.o: In function `main':
dnsd.c:(.text.startup+0x1d6): undefined reference to `recvmsg'
dnsd.c:(.text.startup+0x271): undefined reference to `recvmsg'
collect2: error: ld returned 1 exit status
make: *** [Makefile:306: bin-i386/dnsd] Error 1


Additional info:
* package version(s): 0.33-4
* config and/or log files etc.


Steps to reproduce:

makepkg -si

Possible solution: backport commit fecfb4a5f23821f4d98a8596417b059c7ff7ea62 from
https://github.com/ensc/dietlibc

as dietlib-i386-pic.patch:

diff --git a/i386/syscalls.h b/i386/syscalls.h
index c4c98629..94f9be53 100644
--- a/i386/syscalls.h
+++ b/i386/syscalls.h
@@ -368,7 +368,6 @@ sym: \
.Lend##sym: ; \
.size sym,.Lend##sym-sym

-#ifndef __PIC__
#define __socketcall(name,NAME) \
.text; \
.type name,@function; \
@@ -381,6 +380,3 @@ __libc_##name: ; \
jmp socketcall; \
.Lend##name:; \
.size name,.Lend##name-name
-#else
-#define __socketcall(name,NAME)
-#endif

The commit says:

commit fecfb4a5f23821f4d98a8596417b059c7ff7ea62
Author: Benedikt B<C3><B6>hm <bb@xnull.de>
Date: Sat Jan 3 17:17:22 2009 +0100

define socketcall wth PIC too

I personally don't understand the reason, why the socketcall stub should not
be defined when using -fpic.

Newer git versions of dietlibc use the new setsockopt, socket, etc. kernel
syscalls and no longer the socketcall super-call.
This task depends upon

Closed by  Eli Schwartz (eschwartz)
Monday, 01 January 2018, 03:23 GMT
Reason for closing:  Won't fix
Additional comments about closing:  We no longer support i386 at all.

Loading...