redhat-lsb 4.0 doesn't build on ARM. The problem is a compound one:
1) The PPC triggerfix patch causes __libc_start_main duplicate
definition.
Fixed redhat-lsb-triggerfix.patch is attached.
2) Also in triggerfix same patch, there are duplicate definitions of:
__libc_csu_init
__libc_csu_fini
which seem to be just stubs in redhat_lsb_trigger.c. So I added an
ifndef __arm__ around them.
3) The arm fix from lsb 3.x is still required (slightly modified,
attached)
Is there a bugzilla ticket for this already raised? If so, can somebody
provide a ticket number so I can put these patches there if it's not
already fixed?
This should fix the F13+/RHEL6+ redhat-lsb build issues for 4.0.
Whether it actually works - I don't know yet.
Thanks.
Gordan
--- redhat_lsb_trigger.c.triggerfix 2008-04-16 18:50:14.000000000 +0100
+++ redhat_lsb_trigger.c 2011-09-14 11:50:42.563080000 +0100
@@ -423,10 +423,76 @@
#define is_ia64() 0
#endif
+char *
+strtok (char *p, const char *delim)
+{
+ static char *olds;
+ const char *d;
+ char *token;
+ if (p == NULL)
+ p = olds;
+ while (*p)
+ {
+ for (d = delim; *d; d++)
+ if (*p == *d)
+ break;
+ if (!*d)
+ break;
+ p++;
+ }
+ if (!*p)
+ {
+ olds = p;
+ return NULL;
+ }
+ token = p;
+ while (*p)
+ {
+ for (d = delim; *d; d++)
+ if (*p == *d)
+ break;
+ if (*d)
+ break;
+ p++;
+ }
+ if (!*p)
+ olds = p;
+ else
+ {
+ *p = '\0';
+ olds = p + 1;
+ }
+ return token;
+}
+
+size_t
+strlen (const char *s)
+{
+ const char *p;
+ for (p = s; *p; ++p);
+ return p - s;
+}
+
+void *
+mempcpy (void *dst, const void *src, size_t n)
+{
+ char *d = dst;
+ const char *s = src;
+ while (n--)
+ *d++ = *s++;
+ return d;
+}
+
+char *
+strcpy (char *dst, const char *src)
+{
+ char *ret = dst;
+ while ((*dst++ = *src++) != '\0');
+ return ret;
+}
+
int main (int argc, char **argv)
{
-/* redhat_lsb_trigger.c:428: warning: unused variable 'ret' */
-/* long ret; */
INTERNAL_SYSCALL_DECL (err);
char lsbsover[] = LSBSOVER;
char *LSBVER, *p = lsbsover;
@@ -450,15 +516,38 @@
int __libc_multiple_threads __attribute__((nocommon));
int __libc_enable_asynccancel (void) { return 0; }
void __libc_disable_asynccancel (int x) { }
+#ifndef __arm__
void __libc_csu_init (void) { }
void __libc_csu_fini (void) { }
+#endif
pid_t __fork (void) { return -1; }
char thr_buf[65536];
-#ifndef __powerpc__
+void
+__attribute__ ((noreturn))
+__stack_chk_fail (void)
+{
+ INTERNAL_SYSCALL_DECL (err);
+ while (1)
+ INTERNAL_SYSCALL (exit, err, 1, 1);
+}
+
+#if defined __powerpc__
+
+struct startup_info
+{
+ void *sda_base;
+ int (*main) (int, char **, char **, void *);
+ int (*init) (int, char **, char **, void *);
+ void (*fini) (void);
+};
+
+int __libc_start_main (int argc, char **argv, char **ev,
+ void *auxvec, void (*rtld_fini) (void),
+ struct startup_info *stinfo,
+ char **stack_on_entry)
+#elif defined __arm__
-/* /usr/lib/gcc/ppc64-redhat-linux/4.1.2/../../../../lib64/libc.a(libc-start.o): In function `__libc_start_main':
- * * (.opd+0x10): multiple definition of `__libc_start_main' */
int ___libc_start_main (int (*main) (int argc, char **argv),
int argc, char **argv,
void (*init) (void), void (*fini) (void),
@@ -472,9 +561,7 @@
void (*fini) (void);
};
-/* /usr/lib/gcc/ppc64-redhat-linux/4.1.2/../../../../lib64/libc.a(libc-start.o): In function `__libc_start_main':
- * (.opd+0x10): multiple definition of `__libc_start_main' */
-int ___libc_start_main (int argc, char **argv, char **ev,
+int __libc_start_main (int argc, char **argv, char **ev,
void *auxvec, void (*rtld_fini) (void),
struct startup_info *stinfo,
char **stack_on_entry)
--- redhat-lsb-3.2.orig/redhat_lsb_trigger.c 2008-04-16 13:50:14.000000000 -0400
+++ redhat-lsb-3.2/redhat_lsb_trigger.c 2009-02-03 04:39:06.000000000 -0500
@@ -223,6 +223,42 @@ register void *__thread_self __asm ("g7"
# define ASMFMT_1 , "0" (gpr2)
# define ASMFMT_2 , "0" (gpr2), "d" (gpr3)
# define ASMFMT_3 , "0" (gpr2), "d" (gpr3), "d" (gpr4)
+#elif defined __arm__
+# if defined (__ARM_EABI__)
+#undef INTERNAL_SYSCALL_DECL
+#define INTERNAL_SYSCALL_DECL(err) do { } while (0)
+#undef INTERNAL_SYSCALL_RAW
+#define INTERNAL_SYSCALL_RAW(name, err, nr, args...) \
+ ({ \
+ register int _a1 asm ("r0"), _nr asm ("r7"); \
+ LOAD_ARGS_##nr (args) \
+ _nr = name; \
+ asm volatile ("swi 0x0 @ syscall " #name \
+ : "=r" (_a1) \
+ : "r" (_nr) ASM_ARGS_##nr \
+ : "memory"); \
+ _a1; })
+
+#undef INTERNAL_SYSCALL
+#define INTERNAL_SYSCALL(name, err, nr, args...) \
+ INTERNAL_SYSCALL_RAW(SYS_ify(name), err, nr, args)
+
+#define LOAD_ARGS_0()
+#define ASM_ARGS_0
+#define LOAD_ARGS_1(a1) \
+ int _a1tmp = (int) (a1); \
+ LOAD_ARGS_0 () \
+ _a1 = _a1tmp;
+#define ASM_ARGS_1 ASM_ARGS_0, "r" (_a1)
+#define LOAD_ARGS_2(a1, a2) \
+ int _a2tmp = (int) (a2); \
+ LOAD_ARGS_1 (a1) \
+ register int _a2 asm ("a2") = _a2tmp;
+#define ASM_ARGS_2 ASM_ARGS_1, "r" (_a2)
+#undef SYS_ify
+#define SWI_BASE (0x900000)
+#define SYS_ify(syscall_name) (__NR_##syscall_name)
+#endif
#elif defined __sparc__
# ifndef __arch64__
# define __INTERNAL_SYSCALL_STRING \
_______________________________________________
arm mailing list
arm@xxxxxxxxxxxxxxxxxxxxxxx
https://admin.fedoraproject.org/mailman/listinfo/arm