summaryrefslogtreecommitdiff
path: root/package/broadcom-wl/compat-ldso/patches/100-start_main.patch
diff options
context:
space:
mode:
Diffstat (limited to 'package/broadcom-wl/compat-ldso/patches/100-start_main.patch')
-rw-r--r--package/broadcom-wl/compat-ldso/patches/100-start_main.patch66
1 files changed, 66 insertions, 0 deletions
diff --git a/package/broadcom-wl/compat-ldso/patches/100-start_main.patch b/package/broadcom-wl/compat-ldso/patches/100-start_main.patch
new file mode 100644
index 0000000000..5f4c0d5c70
--- /dev/null
+++ b/package/broadcom-wl/compat-ldso/patches/100-start_main.patch
@@ -0,0 +1,66 @@
+Index: uClibc-0.9.28.2/ldso/ldso/dl-hash.c
+===================================================================
+--- uClibc-0.9.28.2.orig/ldso/ldso/dl-hash.c 2007-11-09 03:35:13.193591913 +0100
++++ uClibc-0.9.28.2/ldso/ldso/dl-hash.c 2007-11-09 03:52:41.713343652 +0100
+@@ -124,6 +124,15 @@
+ return tpnt;
+ }
+
++void (*__uClibc_main)(void *main, int argc, char **argv, void (*app_init)(void), void (*app_fini)(void), void *, void *) = NULL;
++int (*main)(int argc, char **argv, char **envp) = NULL;
++void
++__uClibc_start_main(int argc, char **argv, char **envp,
++ void (*app_fini)(void), void (*app_init)(void))
++{
++ __uClibc_main(main, argc, argv, app_init, app_fini, NULL, NULL);
++}
++
+
+ /*
+ * This function resolves externals, and this is either called when we process
+@@ -139,6 +148,12 @@
+ const ElfW(Sym) *sym;
+ char *weak_result = NULL;
+
++ if (_dl_strcmp(name, "__uClibc_start_main") == 0) {
++ main = _dl_find_hash("main", rpnt, mytpnt, type_class);
++ __uClibc_main = _dl_find_hash("__uClibc_main", rpnt, mytpnt, type_class);
++ return (char *) &__uClibc_start_main;
++ }
++
+ elf_hash_number = _dl_elf_hash(name);
+
+ for (; rpnt; rpnt = rpnt->next) {
+Index: uClibc-0.9.28.2/Makefile
+===================================================================
+--- uClibc-0.9.28.2.orig/Makefile 2007-11-09 03:54:20.814991133 +0100
++++ uClibc-0.9.28.2/Makefile 2007-11-09 03:58:56.346692786 +0100
+@@ -28,10 +28,7 @@
+ TOPDIR=./
+ include Rules.mak
+
+-DIRS = ldso libc libcrypt libresolv libnsl libutil libm libpthread librt
+-ifeq ($(strip $(UCLIBC_HAS_GETTEXT_AWARENESS)),y)
+- DIRS += libintl
+-endif
++DIRS = ldso
+
+ ifeq ($(strip $(HAVE_DOT_CONFIG)),y)
+
+@@ -47,16 +44,6 @@
+ $(SECHO)
+ @$(MAKE) -C libc shared
+ @$(MAKE) -C ldso shared
+- @$(MAKE) -C libcrypt shared
+- @$(MAKE) -C libresolv shared
+- @$(MAKE) -C libnsl shared
+- @$(MAKE) -C libutil shared
+- @$(MAKE) -C libm shared
+- @$(MAKE) -C libpthread shared
+- @$(MAKE) -C librt shared
+-ifeq ($(strip $(UCLIBC_HAS_GETTEXT_AWARENESS)),y)
+- @$(MAKE) -C libintl shared
+-endif
+ else
+ $(SECHO)
+ $(SECHO) Not building shared libraries ...