Ver código fonte

buildsys: Fix kbuild-style switch fallout

regressions introduced in 1b3025b7352f5e432ffa1c7adc57085ac9092b77
"buildsys: switch libc to kbuild-style"

unistd: Handle !UCLIBC_HAS_GET{, SUB}OPT cases

libc/libc_so.a(getsubopt-susv3.os): In function getsubopt':
getsubopt-susv3.c:(.text+0x0): multiple definition of getsubopt'
libc/libc_so.a(getsubopt.os):getsubopt.c:(.text+0x0):
first defined here.

The solution is to filter out the correct files when
UCLIBC_HAS_GETOPT and UCLIBC_HAS_GETSUBOPT are not defined.

inet: Move INET_RPC_{DIR, OUT} before CSRC_ALL

libc/libc_so.a(rpc_thread.oS): In function __rpc_thread_svc_max_pollfd':
rpc_thread.c:(.text+0x148): undefined reference to svc_max_pollfd'
libc/libc_so.a(rpc_thread.oS): In function __rpc_thread_svc_pollfd':
rpc_thread.c:(.text+0x184): undefined reference to svc_pollfd'

The CSRC_ALL variable uses the INET_RPC_DIR variable which is
initialized later on. We fix this problem by moving the
INET_RCP_{DIR,OUT} definitions before we use them in CSRC_ALL

Signed-off-by: Markos Chandras <markos.chandras@imgtec.com>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
Markos Chandras 11 anos atrás
pai
commit
b222a04ae7
2 arquivos alterados com 7 adições e 8 exclusões
  1. 4 3
      libc/inet/rpc/Makefile.in
  2. 3 5
      libc/unistd/Makefile.in

+ 4 - 3
libc/inet/rpc/Makefile.in

@@ -18,15 +18,16 @@ CSRC_NFS = authunix_prot.c auth_none.c auth_unix.c bindresvport.c \
 	rpc_prot.c rpc_thread.c rtime.c ruserpass.c sa_len.c \
 	svc.c svc_auth.c svc_authux.c \
 	xdr.c xdr_array.c xdr_mem.c xdr_rec.c xdr_reference.c
+
+INET_RPC_DIR:=$(top_srcdir)libc/inet/rpc
+INET_RPC_OUT:=$(top_builddir)libc/inet/rpc
+
 CSRC_ALL = $(notdir $(wildcard $(INET_RPC_DIR)/*.c))
 CSRC-y := $(if $(UCLIBC_HAS_FULL_RPC),$(CSRC_ALL),$(CSRC_NFS))
 # rpc_thread.oS is better, because the header adds unneeded references
 # to __pthread_internal_tsd*
 CSRC-y := $(filter-out rpc_thread.c,$(CSRC-y))
 
-INET_RPC_DIR:=$(top_srcdir)libc/inet/rpc
-INET_RPC_OUT:=$(top_builddir)libc/inet/rpc
-
 INET_RPC_SRC:=$(patsubst %.c,$(INET_RPC_DIR)/%.c,$(CSRC-y))
 INET_RPC_OBJ:=$(patsubst %.c,$(INET_RPC_OUT)/%.o,$(CSRC-y))
 

+ 3 - 5
libc/unistd/Makefile.in

@@ -16,12 +16,10 @@ OMIT-$(ARCH_USE_MMU) += __exec_alloc.c
 OMIT-$(if $(UCLIBC_SUSV3_LEGACY),,y) += ualarm.c usleep.c
 #OMIT-$(UCLIBC_HAS_THREADS_NATIVE) += sleep.c
 
-# the VARIANT we OMIT
-# GNU_GETOPT comes with getopt_long unconditionally (?), OMIT the other
-VARIANT := $(if $(UCLIBC_HAS_GNU_GETOPT),-susv3)
+# XXX: GNU_GETOPT comes with getopt_long unconditionally, which is wrong
 GO_LONG := $(if $(UCLIBC_HAS_GNU_GETOPT),getopt_long-simple.c)
-OMIT-$(UCLIBC_HAS_GNU_GETOPT) += getopt$(VARIANT).c $(GO_LONG)
-OMIT-$(UCLIBC_HAS_GNU_GETSUBOPT) += getsubopt$(VARIANT).c
+OMIT-y += $(if $(UCLIBC_HAS_GNU_GETOPT),getopt-susv3.c $(GO_LONG),getopt.c)
+OMIT-y += $(if $(UCLIBC_HAS_GNU_GETSUBOPT),getsubopt-susv3.c,getsubopt.c)
 
 CSRC-y := $(filter-out $(OMIT-y),$(CSRC-y))