Browse Source

Fix missing include in __uClibc_main

Commit 227b7c825b6c79479f7222be03e83991b927da26 introduced a dependency
on _dl_auxvt but missed to include the header defining the symbol.

Include the ldso.h header that defines this and safeguard other parts of
that header that do not play nice if fcntl.h has already been included.
The latter is the case only for __uClibc_main.c.

Reviewed-by: Georg Kotheimer <georg.kotheimer@kernkonzept.com>
Signed-off-by: Marcus Haehnel <marcus.haehnel@kernkonzept.com>
Marcus Haehnel 1 month ago
parent
commit
0fb6b45352
2 changed files with 4 additions and 0 deletions
  1. 2 0
      ldso/include/ldso.h
  2. 2 0
      libc/misc/internals/__uClibc_main.c

+ 2 - 0
ldso/include/ldso.h

@@ -34,6 +34,7 @@
 #include <stdarg.h>
 #include <stddef.h> /* for ptrdiff_t */
 #include <stdbool.h>
+#if !defined(_FCNTL_H)
 #define _FCNTL_H
 /* We need this if arch has only new syscalls defined */
 #ifndef AT_FDCWD
@@ -190,6 +191,7 @@ extern void *_dl_get_ready_to_run(struct elf_resolve *tpnt, DL_LOADADDR_TYPE loa
 #include <dl-elf.h>
 
 #endif
+#endif /* _FCNTL_H */
 
 #define AUX_MAX_AT_ID 40
 extern ElfW(auxv_t) _dl_auxvt[AUX_MAX_AT_ID]; /* Cache frequently accessed auxiliary vector entries */

+ 2 - 0
libc/misc/internals/__uClibc_main.c

@@ -84,6 +84,8 @@ static void fdpic_init_array_jump(void *addr)
 #ifndef SHARED
 void *__libc_stack_end = NULL;
 
+#include "ldso.h" /* Needed for _dl_auxvt */
+
 # ifdef __UCLIBC_HAS_SSP__
 #  include <dl-osinfo.h>
 static uintptr_t stack_chk_guard;