From bugzilla at busybox.net Mon May 4 06:47:35 2015 From: bugzilla at busybox.net (bugzilla at busybox.net) Date: Mon, 4 May 2015 06:47:35 +0000 (UTC) Subject: [Bug 8061] print 64 bit data in pthread always becomes strange data In-Reply-To: References: Message-ID: <20150504064735.D928F819CD@busybox.osuosl.org> https://bugs.busybox.net/show_bug.cgi?id=8061 --- Comment #5 from BigZJK 2015-05-04 06:47:35 UTC --- Created attachment 6021 --> https://bugs.busybox.net/attachment.cgi?id=6021 test file Actually there are two strange places. Refer to our project code, I wrote two test code. First test the Strtoull API with 16 hex, it can run, but the result is not correct,whatever the num changes, Strtoull always return 0x7fffffffffffffff. Second test printf code in Pthread, but the code throws a segmentation fault(i can`t understand why,the same code of creating pthread can run in our project, althrough the printf is always strange)? The test platform X86-64, os:ubuntu. Test code in the accessory -- Configure bugmail: https://bugs.busybox.net/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug. From rep.dot.nop at gmail.com Wed May 6 20:01:49 2015 From: rep.dot.nop at gmail.com (Bernhard Reutner-Fischer) Date: Wed, 6 May 2015 22:01:49 +0200 Subject: [git commit] update links to ELKS and Linux-8086 C library Message-ID: <20150506200248.05E368042A@busybox.osuosl.org> commit: http://git.uclibc.org/uClibc-website/commit/?id=f29c127ffdf91b925ad542a9141fdca02b390df3 branch: http://git.uclibc.org/uClibc-website/commit/?id=refs/heads/master Signed-off-by: Bernhard Reutner-Fischer --- FAQ.html | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/FAQ.html b/FAQ.html index fb37b41..0c86b6a 100644 --- a/FAQ.html +++ b/FAQ.html @@ -581,8 +581,8 @@ How could it be smaller and not suck? uClibc started off as a fork on the Linux-8086 C library, which is - part of the elks project. + href="https://github.com/lkundrak/dev86/">Linux-8086 C library, which is + part of the elks project. The Linux-8086 C library was, apparently, largely written from scratch but also borrowed code from libc4, glibc, some Atari library code, with bits and pieces from about 20 other places. From rep.dot.nop at gmail.com Wed May 6 20:19:31 2015 From: rep.dot.nop at gmail.com (Bernhard Reutner-Fischer) Date: Wed, 6 May 2015 22:19:31 +0200 Subject: [git commit] init.c (__nptl_initial_report_events): New variable. Message-ID: <20150506202015.61C5981DE9@busybox.osuosl.org> commit: http://git.uclibc.org/uClibc/commit/?id=62175247d977c087e62f067d4db1445f88b61e7b branch: http://git.uclibc.org/uClibc/commit/?id=refs/heads/master (__pthread_initialize_minimal_internal): Initialize pd->report_events to that. This patch helps NPTL report TD_CREATE event, so that GDB could catch the event and update its thread_list. Link: http://lists.uclibc.org/pipermail/uclibc/2015-April/048921.html [shengyong: - original patch from glibc: commit 7d9d8bd18906fdd17364f372b160d7ab896ce909 - context adjust - update nptl_db/ChangeLog] Signed-off-by: Roland McGrath Signed-off-by: Sheng Yong Signed-off-by: Bernhard Reutner-Fischer --- libpthread/nptl_db/ChangeLog | 23 ++++++++ libpthread/nptl_db/db_info.c | 4 +- libpthread/nptl_db/structs.def | 3 +- libpthread/nptl_db/td_ta_map_lwp2thr.c | 69 ++++++++++++++++++------- libpthread/nptl_db/td_ta_thr_iter.c | 25 +++++---- libpthread/nptl_db/td_thr_event_enable.c | 24 ++++++++- libpthread/nptl_db/td_thr_get_info.c | 81 ++++++++++++++++++------------ libpthread/nptl_db/td_thr_getfpregs.c | 7 ++- libpthread/nptl_db/td_thr_getgregs.c | 7 ++- libpthread/nptl_db/td_thr_setfpregs.c | 7 ++- libpthread/nptl_db/td_thr_setgregs.c | 7 ++- libpthread/nptl_db/td_thr_tlsbase.c | 25 ++++++++- libpthread/nptl_db/td_thr_validate.c | 16 ++---- libpthread/nptl_db/thread_dbP.h | 5 ++- 14 files changed, 217 insertions(+), 86 deletions(-) diff --git a/libpthread/nptl_db/ChangeLog b/libpthread/nptl_db/ChangeLog index 52c8491..92021cb 100644 --- a/libpthread/nptl_db/ChangeLog +++ b/libpthread/nptl_db/ChangeLog @@ -1,3 +1,26 @@ +2007-05-16 Roland McGrath + + * td_thr_get_info.c: Fake the results for TH->th_unique == 0. + * td_thr_validate.c: Likewise. + * td_thr_setgregs.c: Likewise. + * td_thr_setfpregs.c: Likewise. + * td_thr_getgregs.c: Likewise. + * td_thr_getfpregs.c: Likewise. + * td_thr_tlsbase.c: Likewise. + + * structs.def: Add DB_VARIABLE (__nptl_initial_report_events). + * db_info.c: Add necessary declaration. + * td_thr_event_enable.c: Set __nptl_initial_report_events too. + + * td_ta_thr_iter.c (iterate_thread_list): Make FAKE_EMPTY bool. + Use th_unique=0 in fake descriptor before initialization. + + * td_ta_map_lwp2thr.c (__td_ta_lookup_th_unique): New function, broken + out of ... + (td_ta_map_lwp2thr): ... here, call it. But don't before __stack_user + is initialized, then fake a handle with th_unique=0. + * thread_dbP.h: Declare it. + 2004-09-09 Roland McGrath * td_ta_map_lwp2thr.c (td_ta_map_lwp2thr): Don't abort if inferior's diff --git a/libpthread/nptl_db/db_info.c b/libpthread/nptl_db/db_info.c index 521ad78..a57a053 100644 --- a/libpthread/nptl_db/db_info.c +++ b/libpthread/nptl_db/db_info.c @@ -1,7 +1,7 @@ /* This file is included by pthread_create.c to define in libpthread all the magic symbols required by libthread_db. - Copyright (C) 2003, 2004 Free Software Foundation, Inc. + Copyright (C) 2003, 2004, 2007 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -37,6 +37,8 @@ typedef struct typedef struct link_map link_map; +/* Actually static in nptl/init.c, but we only need it for typeof. */ +extern bool __nptl_initial_report_events; #define schedparam_sched_priority schedparam.sched_priority diff --git a/libpthread/nptl_db/structs.def b/libpthread/nptl_db/structs.def index 915867b..bb571d4 100644 --- a/libpthread/nptl_db/structs.def +++ b/libpthread/nptl_db/structs.def @@ -1,5 +1,5 @@ /* List of types and symbols in libpthread examined by libthread_db. - Copyright (C) 2003, 2006 Free Software Foundation, Inc. + Copyright (C) 2003, 2006, 2007 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -55,6 +55,7 @@ DB_FUNCTION (__nptl_death_event) DB_SYMBOL (__nptl_threads_events) DB_VARIABLE (__nptl_nthreads) DB_VARIABLE (__nptl_last_event) +DB_VARIABLE (__nptl_initial_report_events) DB_ARRAY_VARIABLE (__pthread_keys) DB_STRUCT (pthread_key_struct) diff --git a/libpthread/nptl_db/td_ta_map_lwp2thr.c b/libpthread/nptl_db/td_ta_map_lwp2thr.c index 9709777..6b4382f 100644 --- a/libpthread/nptl_db/td_ta_map_lwp2thr.c +++ b/libpthread/nptl_db/td_ta_map_lwp2thr.c @@ -1,5 +1,5 @@ /* Which thread is running on an LWP? - Copyright (C) 2003, 2004 Free Software Foundation, Inc. + Copyright (C) 2003, 2004, 2007 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -23,8 +23,8 @@ td_err_e -td_ta_map_lwp2thr (const td_thragent_t *ta_arg, - lwpid_t lwpid, td_thrhandle_t *th) +__td_ta_lookup_th_unique (const td_thragent_t *ta_arg, + lwpid_t lwpid, td_thrhandle_t *th) { td_thragent_t *const ta = (td_thragent_t *) ta_arg; ps_err_e err; @@ -117,9 +117,6 @@ td_ta_map_lwp2thr (const td_thragent_t *ta_arg, switch (ta->ta_howto) { - case ta_howto_unknown: - return TD_DBERR; - default: return TD_DBERR; @@ -131,6 +128,7 @@ td_ta_map_lwp2thr (const td_thragent_t *ta_arg, 0, regs, &addr); if (terr != TD_OK) return terr; + /* In this descriptor the nelem word is overloaded as the bias. */ addr += (int32_t) DB_DESC_NELEM (ta->ta_howto_data.reg); th->th_unique = addr; @@ -142,22 +140,22 @@ td_ta_map_lwp2thr (const td_thragent_t *ta_arg, if (&ps_get_thread_area == NULL) return TD_NOCAPAB; - /* A la x86-64, there is a constant magic index for get_thread_area. */ - if (ps_get_thread_area (ta->ph, lwpid, - ta->ta_howto_data.const_thread_area, - &th->th_unique) != PS_OK) - return TD_ERR; /* XXX Other error value? */ - break; + /* A la x86-64, there is a magic index for get_thread_area. */ + if (ps_get_thread_area (ta->ph, lwpid, + ta->ta_howto_data.const_thread_area, + &th->th_unique) != PS_OK) + return TD_ERR; /* XXX Other error value? */ + break; - case ta_howto_reg_thread_area: + case ta_howto_reg_thread_area: if (&ps_get_thread_area == NULL) return TD_NOCAPAB; - /* A la i386, there is a register with an index for get_thread_area. */ - if (ps_lgetregs (ta->ph, lwpid, regs) != PS_OK) - return TD_ERR; - terr = _td_fetch_value_local (ta, ta->ta_howto_data.reg_thread_area, -1, - 0, regs, &addr); + /* A la i386, a register holds the index for get_thread_area. */ + if (ps_lgetregs (ta->ph, lwpid, regs) != PS_OK) + return TD_ERR; + terr = _td_fetch_value_local (ta, ta->ta_howto_data.reg_thread_area, + -1, 0, regs, &addr); if (terr != TD_OK) return terr; /* In this descriptor the nelem word is overloaded as scale factor. */ @@ -171,7 +169,40 @@ td_ta_map_lwp2thr (const td_thragent_t *ta_arg, } /* Found it. Now complete the `td_thrhandle_t' object. */ - th->th_ta_p = (td_thragent_t *) ta; + th->th_ta_p = ta; return TD_OK; } + +td_err_e +td_ta_map_lwp2thr (const td_thragent_t *ta_arg, + lwpid_t lwpid, td_thrhandle_t *th) +{ + td_thragent_t *const ta = (td_thragent_t *) ta_arg; + + /* We cannot rely on thread registers and such information at all + before __pthread_initialize_minimal has gotten far enough. They + sometimes contain garbage that would confuse us, left by the kernel + at exec. So if it looks like initialization is incomplete, we only + fake a special descriptor for the initial thread. */ + + psaddr_t list; + td_err_e err = DB_GET_SYMBOL (list, ta, __stack_user); + if (err != TD_OK) + return err; + + err = DB_GET_FIELD (list, ta, list, list_t, next, 0); + if (err != TD_OK) + return err; + + if (list == 0) + { + if (ps_getpid (ta->ph) != lwpid) + return TD_ERR; + th->th_ta_p = ta; + th->th_unique = 0; + return TD_OK; + } + + return __td_ta_lookup_th_unique (ta_arg, lwpid, th); +} diff --git a/libpthread/nptl_db/td_ta_thr_iter.c b/libpthread/nptl_db/td_ta_thr_iter.c index 1fd02ef..0f1b2bf 100644 --- a/libpthread/nptl_db/td_ta_thr_iter.c +++ b/libpthread/nptl_db/td_ta_thr_iter.c @@ -1,5 +1,6 @@ /* Iterate over a process's threads. - Copyright (C) 1999,2000,2001,2002,2003,2004 Free Software Foundation, Inc. + Copyright (C) 1999,2000,2001,2002,2003,2004,2007 + Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper , 1999. @@ -23,7 +24,7 @@ static td_err_e iterate_thread_list (td_thragent_t *ta, td_thr_iter_f *callback, void *cbdata_p, td_thr_state_e state, int ti_pri, - psaddr_t head, int fake_empty) + psaddr_t head, bool fake_empty) { td_err_e err; psaddr_t next, ofs; @@ -40,13 +41,13 @@ iterate_thread_list (td_thragent_t *ta, td_thr_iter_f *callback, if (next == 0 && fake_empty) { - /* __pthread_initialize_minimal has not run. - There is just the main thread to return. */ - td_thrhandle_t th; - err = td_ta_map_lwp2thr (ta, ps_getpid (ta->ph), &th); - if (err == TD_OK) - err = callback (&th, cbdata_p) != 0 ? TD_DBERR : TD_OK; - return err; + /* __pthread_initialize_minimal has not run. There is just the main + thread to return. We cannot rely on its thread register. They + sometimes contain garbage that would confuse us, left by the + kernel at exec. So if it looks like initialization is incomplete, + we only fake a special descriptor for the initial thread. */ + td_thrhandle_t th = { ta, 0 }; + return callback (&th, cbdata_p) != 0 ? TD_DBERR : TD_OK; } /* Cache the offset from struct pthread to its list_t member. */ @@ -135,13 +136,15 @@ td_ta_thr_iter (const td_thragent_t *ta_arg, td_thr_iter_f *callback, err = DB_GET_SYMBOL (list, ta, __stack_user); if (err == TD_OK) - err = iterate_thread_list (ta, callback, cbdata_p, state, ti_pri, list, 1); + err = iterate_thread_list (ta, callback, cbdata_p, state, ti_pri, + list, true); /* And the threads with stacks allocated by the implementation. */ if (err == TD_OK) err = DB_GET_SYMBOL (list, ta, stack_used); if (err == TD_OK) - err = iterate_thread_list (ta, callback, cbdata_p, state, ti_pri, list, 0); + err = iterate_thread_list (ta, callback, cbdata_p, state, ti_pri, + list, false); return err; } diff --git a/libpthread/nptl_db/td_thr_event_enable.c b/libpthread/nptl_db/td_thr_event_enable.c index f49682d..fd94580 100644 --- a/libpthread/nptl_db/td_thr_event_enable.c +++ b/libpthread/nptl_db/td_thr_event_enable.c @@ -1,5 +1,5 @@ /* Enable event process-wide. - Copyright (C) 1999, 2001, 2002, 2003 Free Software Foundation, Inc. + Copyright (C) 1999, 2001, 2002, 2003, 2007 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper , 1999. @@ -25,7 +25,25 @@ td_thr_event_enable (const td_thrhandle_t *th, int onoff) { LOG ("td_thr_event_enable"); - /* Write the new value into the thread data structure. */ - return DB_PUT_FIELD (th->th_ta_p, th->th_unique, pthread, report_events, 0, + if (th->th_unique != 0) + { + /* Write the new value into the thread data structure. */ + td_err_e err = DB_PUT_FIELD (th->th_ta_p, th->th_unique, pthread, + report_events, 0, + (psaddr_t) 0 + (onoff != 0)); + if (err != TD_OK) + return err; + + /* Just in case we are in the window between initializing __stack_user + and copying from __nptl_initial_report_events, we set it too. + It doesn't hurt to do this for non-initial threads, since it + won't be consulted again anyway. It would take another fetch + to get the tid and determine this isn't the initial thread, + so just do it always. */ + } + + /* We are faking it for the initial thread before its thread + descriptor is set up. */ + return DB_PUT_VALUE (th->th_ta_p, __nptl_initial_report_events, 0, (psaddr_t) 0 + (onoff != 0)); } diff --git a/libpthread/nptl_db/td_thr_get_info.c b/libpthread/nptl_db/td_thr_get_info.c index 09d0d1a..27d5d70 100644 --- a/libpthread/nptl_db/td_thr_get_info.c +++ b/libpthread/nptl_db/td_thr_get_info.c @@ -1,5 +1,5 @@ /* Get thread information. - Copyright (C) 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc. + Copyright (C) 1999,2000,2001,2002,2003,2007 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper , 1999. @@ -31,35 +31,49 @@ td_thr_get_info (const td_thrhandle_t *th, td_thrinfo_t *infop) LOG ("td_thr_get_info"); - /* Copy the whole descriptor in once so we can access the several - fields locally. Excess copying in one go is much better than - multiple ps_pdread calls. */ - err = DB_GET_STRUCT (copy, th->th_ta_p, th->th_unique, pthread); - if (err != TD_OK) - return err; - - err = DB_GET_FIELD_ADDRESS (tls, th->th_ta_p, th->th_unique, - pthread, specific, 0); - if (err != TD_OK) - return err; - - err = DB_GET_FIELD_LOCAL (schedpolicy, th->th_ta_p, copy, pthread, - schedpolicy, 0); - if (err != TD_OK) - return err; - err = DB_GET_FIELD_LOCAL (schedprio, th->th_ta_p, copy, pthread, - schedparam_sched_priority, 0); - if (err != TD_OK) - return err; - err = DB_GET_FIELD_LOCAL (tid, th->th_ta_p, copy, pthread, tid, 0); - if (err != TD_OK) - return err; - err = DB_GET_FIELD_LOCAL (cancelhandling, th->th_ta_p, copy, pthread, - cancelhandling, 0); - if (err != TD_OK) - return err; - err = DB_GET_FIELD_LOCAL (report_events, th->th_ta_p, copy, pthread, - report_events, 0); + if (th->th_unique == 0) + { + /* Special case for the main thread before initialization. */ + copy = NULL; + tls = 0; + cancelhandling = 0; + schedprio = 0; + tid = 0; + err = DB_GET_VALUE (report_events, th->th_ta_p, + __nptl_initial_report_events, 0); + } + else + { + /* Copy the whole descriptor in once so we can access the several + fields locally. Excess copying in one go is much better than + multiple ps_pdread calls. */ + err = DB_GET_STRUCT (copy, th->th_ta_p, th->th_unique, pthread); + if (err != TD_OK) + return err; + + err = DB_GET_FIELD_ADDRESS (tls, th->th_ta_p, th->th_unique, + pthread, specific, 0); + if (err != TD_OK) + return err; + + err = DB_GET_FIELD_LOCAL (schedpolicy, th->th_ta_p, copy, pthread, + schedpolicy, 0); + if (err != TD_OK) + return err; + err = DB_GET_FIELD_LOCAL (schedprio, th->th_ta_p, copy, pthread, + schedparam_sched_priority, 0); + if (err != TD_OK) + return err; + err = DB_GET_FIELD_LOCAL (tid, th->th_ta_p, copy, pthread, tid, 0); + if (err != TD_OK) + return err; + err = DB_GET_FIELD_LOCAL (cancelhandling, th->th_ta_p, copy, pthread, + cancelhandling, 0); + if (err != TD_OK) + return err; + err = DB_GET_FIELD_LOCAL (report_events, th->th_ta_p, copy, pthread, + report_events, 0); + } if (err != TD_OK) return err; @@ -86,9 +100,10 @@ td_thr_get_info (const td_thrhandle_t *th, td_thrinfo_t *infop) infop->ti_lid = tid == 0 ? ps_getpid (th->th_ta_p->ph) : (uintptr_t) tid; infop->ti_traceme = report_events != 0; - err = DB_GET_FIELD_LOCAL (infop->ti_startfunc, th->th_ta_p, copy, pthread, - start_routine, 0); - if (err == TD_OK) + if (copy != NULL) + err = DB_GET_FIELD_LOCAL (infop->ti_startfunc, th->th_ta_p, copy, pthread, + start_routine, 0); + if (copy != NULL && err == TD_OK) { uint32_t idx; for (idx = 0; idx < TD_EVENTSIZE; ++idx) diff --git a/libpthread/nptl_db/td_thr_getfpregs.c b/libpthread/nptl_db/td_thr_getfpregs.c index ff4b599..4f4742a 100644 --- a/libpthread/nptl_db/td_thr_getfpregs.c +++ b/libpthread/nptl_db/td_thr_getfpregs.c @@ -1,5 +1,5 @@ /* Get a thread's floating-point register set. - Copyright (C) 1999, 2001, 2002, 2003 Free Software Foundation, Inc. + Copyright (C) 1999, 2001, 2002, 2003, 2007 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper , 1999. @@ -28,6 +28,11 @@ td_thr_getfpregs (const td_thrhandle_t *th, prfpregset_t *regset) LOG ("td_thr_getfpregs"); + if (th->th_unique == 0) + /* Special case for the main thread before initialization. */ + return ps_lgetfpregs (th->th_ta_p->ph, ps_getpid (th->th_ta_p->ph), + regset) != PS_OK ? TD_ERR : TD_OK; + /* We have to get the state and the PID for this thread. */ err = DB_GET_FIELD (cancelhandling, th->th_ta_p, th->th_unique, pthread, cancelhandling, 0); diff --git a/libpthread/nptl_db/td_thr_getgregs.c b/libpthread/nptl_db/td_thr_getgregs.c index 497941b..d5f0f61 100644 --- a/libpthread/nptl_db/td_thr_getgregs.c +++ b/libpthread/nptl_db/td_thr_getgregs.c @@ -1,5 +1,5 @@ /* Get a thread's general register set. - Copyright (C) 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc. + Copyright (C) 1999, 2000, 2001, 2002, 2003, 2007 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper , 1999. @@ -28,6 +28,11 @@ td_thr_getgregs (const td_thrhandle_t *th, prgregset_t regset) LOG ("td_thr_getgregs"); + if (th->th_unique == 0) + /* Special case for the main thread before initialization. */ + return ps_lgetregs (th->th_ta_p->ph, ps_getpid (th->th_ta_p->ph), + regset) != PS_OK ? TD_ERR : TD_OK; + /* We have to get the state and the PID for this thread. */ err = DB_GET_FIELD (cancelhandling, th->th_ta_p, th->th_unique, pthread, cancelhandling, 0); diff --git a/libpthread/nptl_db/td_thr_setfpregs.c b/libpthread/nptl_db/td_thr_setfpregs.c index 3c4e8ed..3154953 100644 --- a/libpthread/nptl_db/td_thr_setfpregs.c +++ b/libpthread/nptl_db/td_thr_setfpregs.c @@ -1,5 +1,5 @@ /* Set a thread's floating-point register set. - Copyright (C) 1999, 2001, 2002, 2003 Free Software Foundation, Inc. + Copyright (C) 1999, 2001, 2002, 2003, 2007 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper , 1999. @@ -28,6 +28,11 @@ td_thr_setfpregs (const td_thrhandle_t *th, const prfpregset_t *fpregs) LOG ("td_thr_setfpregs"); + if (th->th_unique == 0) + /* Special case for the main thread before initialization. */ + return ps_lsetfpregs (th->th_ta_p->ph, ps_getpid (th->th_ta_p->ph), + fpregs) != PS_OK ? TD_ERR : TD_OK; + /* We have to get the state and the PID for this thread. */ err = DB_GET_FIELD (cancelhandling, th->th_ta_p, th->th_unique, pthread, cancelhandling, 0); diff --git a/libpthread/nptl_db/td_thr_setgregs.c b/libpthread/nptl_db/td_thr_setgregs.c index 83d2cd9..5945dea 100644 --- a/libpthread/nptl_db/td_thr_setgregs.c +++ b/libpthread/nptl_db/td_thr_setgregs.c @@ -1,5 +1,5 @@ /* Set a thread's general register set. - Copyright (C) 1999, 2001, 2002, 2003 Free Software Foundation, Inc. + Copyright (C) 1999, 2001, 2002, 2003, 2007 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper , 1999. @@ -28,6 +28,11 @@ td_thr_setgregs (const td_thrhandle_t *th, prgregset_t gregs) LOG ("td_thr_setgregs"); + if (th->th_unique == 0) + /* Special case for the main thread before initialization. */ + return ps_lsetregs (th->th_ta_p->ph, ps_getpid (th->th_ta_p->ph), + gregs) != PS_OK ? TD_ERR : TD_OK; + /* We have to get the state and the PID for this thread. */ err = DB_GET_FIELD (cancelhandling, th->th_ta_p, th->th_unique, pthread, cancelhandling, 0); diff --git a/libpthread/nptl_db/td_thr_tlsbase.c b/libpthread/nptl_db/td_thr_tlsbase.c index f7d4c29..9f98bd9 100644 --- a/libpthread/nptl_db/td_thr_tlsbase.c +++ b/libpthread/nptl_db/td_thr_tlsbase.c @@ -1,5 +1,5 @@ /* Locate TLS data for a thread. - Copyright (C) 2003, 2006 Free Software Foundation, Inc. + Copyright (C) 2003, 2006, 2007 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -29,8 +29,29 @@ td_thr_tlsbase (const td_thrhandle_t *th, if (modid < 1) return TD_NOTLS; + psaddr_t pd = th->th_unique; + if (pd == 0) + { + /* This is the fake handle for the main thread before libpthread + initialization. We are using 0 for its th_unique because we can't + trust that its thread register has been initialized. But we need + a real pointer to have any TLS access work. In case of dlopen'd + libpthread, initialization might not be for quite some time. So + try looking up the thread register now. Worst case, it's nonzero + uninitialized garbage and we get bogus results for TLS access + attempted too early. Tough. */ + + td_thrhandle_t main_th; + err = __td_ta_lookup_th_unique (th->th_ta_p, ps_getpid (th->th_ta_p->ph), + &main_th); + if (err == 0) + pd = main_th.th_unique; + if (pd == 0) + return TD_TLSDEFER; + } + /* Get the DTV pointer from the thread descriptor. */ - err = DB_GET_FIELD (dtv, th->th_ta_p, th->th_unique, pthread, dtvp, 0); + err = DB_GET_FIELD (dtv, th->th_ta_p, pd, pthread, dtvp, 0); if (err != TD_OK) return err; diff --git a/libpthread/nptl_db/td_thr_validate.c b/libpthread/nptl_db/td_thr_validate.c index 49c30c1..1b96b51 100644 --- a/libpthread/nptl_db/td_thr_validate.c +++ b/libpthread/nptl_db/td_thr_validate.c @@ -1,5 +1,5 @@ /* Validate a thread handle. - Copyright (C) 1999, 2001, 2002, 2003, 2004 Free Software Foundation, Inc. + Copyright (C) 1999,2001,2002,2003,2004,2007 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper , 1999. @@ -74,16 +74,10 @@ td_thr_validate (const td_thrhandle_t *th) if (err == TD_OK) err = check_thread_list (th, list, &uninit); - if (err == TD_NOTHR && uninit) - { - /* __pthread_initialize_minimal has not run yet. - But the main thread still has a valid ID. */ - td_thrhandle_t main_th; - err = td_ta_map_lwp2thr (th->th_ta_p, - ps_getpid (th->th_ta_p->ph), &main_th); - if (err == TD_OK && th->th_unique != main_th.th_unique) - err = TD_NOTHR; - } + if (err == TD_NOTHR && uninit && th->th_unique == 0) + /* __pthread_initialize_minimal has not run yet. + There is only the special case thread handle. */ + err = TD_OK; } return err; diff --git a/libpthread/nptl_db/thread_dbP.h b/libpthread/nptl_db/thread_dbP.h index 24623ef..b8399f7 100644 --- a/libpthread/nptl_db/thread_dbP.h +++ b/libpthread/nptl_db/thread_dbP.h @@ -1,5 +1,5 @@ /* Private header for thread debug library - Copyright (C) 2003, 2004 Free Software Foundation, Inc. + Copyright (C) 2003, 2004, 2007 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -254,4 +254,7 @@ extern td_err_e _td_store_value_local (td_thragent_t *ta, extern td_err_e _td_check_sizeof (td_thragent_t *ta, uint32_t *sizep, int sizep_name) attribute_hidden; +extern td_err_e __td_ta_lookup_th_unique (const td_thragent_t *ta, + lwpid_t lwpid, td_thrhandle_t *th); + #endif /* thread_dbP.h */ From rep.dot.nop at gmail.com Wed May 6 20:38:38 2015 From: rep.dot.nop at gmail.com (Bernhard Reutner-Fischer) Date: Wed, 6 May 2015 22:38:38 +0200 Subject: [git commit] nptl_db: fix ommitting td_ta_setconcurrency Message-ID: <20150506204041.F0F9680826@busybox.osuosl.org> commit: http://git.uclibc.org/uClibc/commit/?id=bfbcc35b0ff8e40570a99872fd538e344d8c7f75 branch: http://git.uclibc.org/uClibc/commit/?id=refs/heads/master Signed-off-by: Bernhard Reutner-Fischer --- libpthread/nptl_db/Makefile.in | 8 ++++---- 1 files changed, 4 insertions(+), 4 deletions(-) diff --git a/libpthread/nptl_db/Makefile.in b/libpthread/nptl_db/Makefile.in index 76102e6..5a493d8 100644 --- a/libpthread/nptl_db/Makefile.in +++ b/libpthread/nptl_db/Makefile.in @@ -22,13 +22,13 @@ libthread_db_FULL_NAME := libthread_db-$(VERSION).so libthread_db_DIR := $(top_srcdir)libpthread/nptl_db libthread_db_OUT := $(top_builddir)libpthread/nptl_db -libthread_db_SRC := $(wildcard $(libthread_db_DIR)/td_*.c) \ - $(libthread_db_DIR)/fetch-value.c +libthread_db_SRC := $(notdir $(wildcard $(libthread_db_DIR)/td_*.c) \ + $(libthread_db_DIR)/fetch-value.c) ifeq ($(UCLIBC_SUSV4_LEGACY),) libthread_db_SRC := $(filter-out td_ta_setconcurrency.c,$(libthread_db_SRC)) endif -libthread_db_OBJ := $(patsubst $(libthread_db_DIR)/%.c,$(libthread_db_OUT)/%.o,$(libthread_db_SRC)) +libthread_db_OBJ := $(addprefix $(libthread_db_OUT)/,$(libthread_db_SRC:.c=.o)) libthread_db-so-y := $(libthread_db_OBJ:.o=.oS) ifeq ($(DOPIC),y) @@ -37,7 +37,7 @@ else libthread_db-a-y := $(libthread_db_OBJ) endif -libthread_db-multi-y := $(libthread_db_SRC) +libthread_db-multi-y := $(addprefix $(libthread_db_DIR)/,$(libthread_db_SRC)) lib-a-$(PTHREADS_DEBUG_SUPPORT) += $(top_builddir)lib/libthread_db.a lib-so-$(PTHREADS_DEBUG_SUPPORT) += $(top_builddir)lib/libthread_db.so From bugzilla at busybox.net Fri May 8 02:48:33 2015 From: bugzilla at busybox.net (bugzilla at busybox.net) Date: Fri, 8 May 2015 02:48:33 +0000 (UTC) Subject: [Bug 8061] print 64 bit data in pthread always becomes strange data In-Reply-To: References: Message-ID: <20150508024833.F0F3B80422@busybox.osuosl.org> https://bugs.busybox.net/show_bug.cgi?id=8061 --- Comment #6 from BigZJK 2015-05-08 02:48:33 UTC --- (In reply to comment #5) > Created attachment 6021 [details] > test file > > Actually there are two strange places. > Refer to our project code, I wrote two test code. > First test the Strtoull API with 16 hex, it can run, but the result is not > correct,whatever the num changes, Strtoull always return 0x7fffffffffffffff. > Second test printf code in Pthread, but the code throws a segmentation fault(i > can`t understand why,the same code of creating pthread can run in our project, > althrough the printf is always strange)? > The test platform X86-64, os:ubuntu. > Test code in the accessory sorry, now we resolved it, maybe it`s not uClibc`s problem, but the complier gcc: in my project, when i create a pthread, it`s stack was not 8b aligned, then the result always become strange.Just keep the stack base address 8b aligned, it`s ok. -- Configure bugmail: https://bugs.busybox.net/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug. From bugzilla at busybox.net Fri May 8 06:12:35 2015 From: bugzilla at busybox.net (bugzilla at busybox.net) Date: Fri, 8 May 2015 06:12:35 +0000 (UTC) Subject: [Bug 8061] print 64 bit data in pthread always becomes strange data In-Reply-To: References: Message-ID: <20150508061235.9C0BA81DB6@busybox.osuosl.org> https://bugs.busybox.net/show_bug.cgi?id=8061 BigZJK changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED Resolution| |INVALID -- Configure bugmail: https://bugs.busybox.net/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug. From rep.dot.nop at gmail.com Wed May 20 10:18:19 2015 From: rep.dot.nop at gmail.com (Bernhard Reutner-Fischer) Date: Wed, 20 May 2015 12:18:19 +0200 Subject: [git commit] test/silly: Extend include path. Message-ID: <20150520102246.E887B800DC@busybox.osuosl.org> commit: http://git.uclibc.org/uClibc/commit/?id=ec0827d3c2af5c9569c04cbb6f57a3c581583722 branch: http://git.uclibc.org/uClibc/commit/?id=refs/heads/master When attempting to build uClibc under buildroot, including building the tests, the silly tests don't currently compile, a result of attempting to build using a compiler that does not yet have an installed version of uClibc available. The error is a missing header file, specifically atomic.h. Taking inspiration from the nptl tests, I have extended the EXTRA_CFLAGS variable to add the required include paths. The tests can now be built under buildroot. Signed-off-by: Andrew Burgess Acked-by: Vineet Gupta Signed-off-by: Bernhard Reutner-Fischer --- test/silly/Makefile.in | 7 +++++++ 1 files changed, 7 insertions(+), 0 deletions(-) diff --git a/test/silly/Makefile.in b/test/silly/Makefile.in index 9bb4032..da83d9a 100644 --- a/test/silly/Makefile.in +++ b/test/silly/Makefile.in @@ -6,3 +6,10 @@ RET_tiny := 42 # missing internal headers, disable these GLIBC_TESTS_DISABLED := tst-atomic_glibc tst-atomic-long_glibc + +atomic_headers := -I$(top_srcdir)libc/sysdeps/linux/$(TARGET_ARCH) \ + -I$(top_srcdir)libc/sysdeps/linux \ + -I$(top_builddir)include + +CFLAGS_tst-atomic = $(atomic_headers) +CFLAGS_tst-atomic-long = $(atomic_headers) From rep.dot.nop at gmail.com Wed May 20 08:59:30 2015 From: rep.dot.nop at gmail.com (Bernhard Reutner-Fischer) Date: Wed, 20 May 2015 10:59:30 +0200 Subject: [git commit] _scanf.c: Implement 'm' modifier for 'c' and '[' conversions. Message-ID: <20150520102246.C37AA81DE6@busybox.osuosl.org> commit: http://git.uclibc.org/uClibc/commit/?id=fe7d30e6337f280a451ac057f47d48349b63e462 branch: http://git.uclibc.org/uClibc/commit/?id=refs/heads/master The current code implements the 'm' modifier only for 's' conversions and would cause a segfault if it was used for 'c' or '[' conversions. This patch extends the code to cover these cases too. The original version could write scanned data outside the passed buffer because index i used in the '[' conversion handling block was clobbered. Signed-off-by: Will Newton Signed-off-by: Max Filippov Signed-off-by: Bernhard Reutner-Fischer --- libc/stdio/_scanf.c | 51 ++++++++++++++++++++++++++++++++----------------- test/stdio/scanf_m.c | 24 +++++++++++++++++++++++ 2 files changed, 57 insertions(+), 18 deletions(-) diff --git a/libc/stdio/_scanf.c b/libc/stdio/_scanf.c index 6ecb3cb..a5828c3 100644 --- a/libc/stdio/_scanf.c +++ b/libc/stdio/_scanf.c @@ -1352,7 +1352,20 @@ int VFSCANF (FILE *__restrict fp, const Wchar *__restrict format, va_list arg) (psfs.conv_num >= CONV_c) #endif /* __UCLIBC_HAS_WCHAR__ */ { + /* We might have to handle the allocation ourselves */ + int len; + unsigned char **ptr; + b = (psfs.store ? ((unsigned char *) psfs.cur_ptr) : buf); + /* With 'm', we actually got a pointer to a pointer */ + ptr = (void *)b; + + if (psfs.flags & FLAG_MALLOC) { + len = 0; + b = NULL; + } else + len = -1; + fail = 1; if (psfs.conv_num == CONV_c) { @@ -1360,32 +1373,28 @@ int VFSCANF (FILE *__restrict fp, const Wchar *__restrict format, va_list arg) sc.width = 1; } + if (psfs.flags & FLAG_MALLOC) + b = malloc(sc.width); + + i = 0; while (__scan_getc(&sc) >= 0) { zero_conversions = 0; - *b = sc.cc; - b += psfs.store; + b[i] = sc.cc; + i += psfs.store; } __scan_ungetc(&sc); if (sc.width > 0) { /* Failed to read all required. */ goto DONE; } + if (psfs.flags & FLAG_MALLOC) + *ptr = b; psfs.cnt += psfs.store; goto NEXT_FMT; } if (psfs.conv_num == CONV_s) { - /* We might have to handle the allocation ourselves */ - int len; - /* With 'm', we actually got a pointer to a pointer */ - unsigned char **ptr = (void *)b; i = 0; - if (psfs.flags & FLAG_MALLOC) { - len = 0; - b = NULL; - } else - len = -1; - /* Yes, believe it or not, a %s conversion can store nuls. */ while ((__scan_getc(&sc) >= 0) && !isspace(sc.cc)) { zero_conversions = 0; @@ -1400,10 +1409,6 @@ int VFSCANF (FILE *__restrict fp, const Wchar *__restrict format, va_list arg) fail = 0; } - if (psfs.flags & FLAG_MALLOC) - *ptr = b; - /* The code below takes care of terminating NUL */ - b += i; } else { #ifdef __UCLIBC_HAS_WCHAR__ assert((psfs.conv_num == CONV_LEFTBRACKET) || \ @@ -1454,13 +1459,20 @@ int VFSCANF (FILE *__restrict fp, const Wchar *__restrict format, va_list arg) #endif /* __UCLIBC_HAS_WCHAR__ */ + i = 0; while (__scan_getc(&sc) >= 0) { zero_conversions = 0; if (!scanset[sc.cc]) { break; } - *b = sc.cc; - b += psfs.store; + if (i == len) { + /* Pick a size that won't trigger a lot of + * mallocs early on ... */ + len += 256; + b = realloc(b, len + 1); + } + b[i] = sc.cc; + i += psfs.store; fail = 0; } } @@ -1470,6 +1482,9 @@ int VFSCANF (FILE *__restrict fp, const Wchar *__restrict format, va_list arg) if (fail) { /* nothing stored! */ goto DONE; } + if (psfs.flags & FLAG_MALLOC) + *ptr = b; + b += i; *b = 0; /* Nul-terminate string. */ psfs.cnt += psfs.store; goto NEXT_FMT; diff --git a/test/stdio/scanf_m.c b/test/stdio/scanf_m.c new file mode 100644 index 0000000..0ce78b6 --- /dev/null +++ b/test/stdio/scanf_m.c @@ -0,0 +1,24 @@ +#include +#include +#include + +int main(void) +{ + const char *buf = "hello world"; + char *ps = NULL, *pc = NULL; + char s[6], c; + + /* Check that %[...]/%c work. */ + sscanf(buf, "%[a-z] %c", s, &c); + /* Check that %m[...]/%mc work. */ + sscanf(buf, "%m[a-z] %mc", &ps, &pc); + + if (strcmp(ps, "hello") != 0 || *pc != 'w' || + strcmp(s, "hello") != 0 || c != 'w') + return 1; + + free(ps); + free(pc); + + return 0; +} From rep.dot.nop at gmail.com Wed May 20 10:25:24 2015 From: rep.dot.nop at gmail.com (Bernhard Reutner-Fischer) Date: Wed, 20 May 2015 12:25:24 +0200 Subject: [git commit branch/0.9.33] common/pread_write.c: backport fix for 64-bit handling of pread/pwrite Message-ID: <20150520102554.253AB81DEA@busybox.osuosl.org> commit: http://git.uclibc.org/uClibc/commit/?id=0aaf783f8d0c2748aee458ecd5b846be595c3068 branch: http://git.uclibc.org/uClibc/commit/?id=refs/heads/0.9.33 Commit 458076d fixed the pread/pwrite syscalls for 64-bit ports on the master branch, but the fix was not backported to the 0.9.33 branch. This patch backports the fix which is critical for e2fsprogs-1.42.12 and above. The introduction of pread64()/pwrite64() in e2fsprogs' commit f00948a broke fsck.ext3 and fsck.ext4 on uclibc-0.9.33, leading to potential data corrupton. See https://bugs.gentoo.org/show_bug.cgi?id=548950 http://git.kernel.org/cgit/fs/ext2/e2fsprogs.git/commit/?id=f00948ad1df100c7d616ef6fbf7609329a2e4001 Signed-off-by: Anthony G. Basile Signed-off-by: Bernhard Reutner-Fischer --- libc/sysdeps/linux/common/pread_write.c | 120 ++++++++++++++++++------------- 1 files changed, 71 insertions(+), 49 deletions(-) diff --git a/libc/sysdeps/linux/common/pread_write.c b/libc/sysdeps/linux/common/pread_write.c index 924509e..51d76a1 100644 --- a/libc/sysdeps/linux/common/pread_write.c +++ b/libc/sysdeps/linux/common/pread_write.c @@ -28,87 +28,109 @@ #define LIBC_CANCEL_HANDLED() /* Nothing. */ #endif -extern __typeof(pread) __libc_pread; -extern __typeof(pwrite) __libc_pwrite; -#ifdef __UCLIBC_HAS_LFS__ -extern __typeof(pread64) __libc_pread64; -extern __typeof(pwrite64) __libc_pwrite64; -#endif - -#ifdef __NR_pread64 /* Newer kernels renamed but it's the same. */ +#ifdef __NR_pread64 # undef __NR_pread # define __NR_pread __NR_pread64 #endif +#ifdef __NR_pwrite64 +# undef __NR_pwrite +# define __NR_pwrite __NR_pwrite64 +#endif -#include - -# define __NR___syscall_pread __NR_pread +#ifndef MY_PREAD +# ifdef __NR_pread +# define __NR___syscall_pread __NR_pread +# if defined(__UCLIBC_SYSCALL_ALIGN_64BIT__) +static _syscall6(ssize_t, __syscall_pread, int, fd, void *, buf, + size_t, count, int, dummy, off_t, offset_hi, off_t, offset_lo) +# define MY_PREAD(fd, buf, count, offset) __syscall_pread(fd, buf, count, 0, OFF_HI_LO(offset)) +# define MY_PREAD64(fd, buf, count, offset) __syscall_pread(fd, buf, count, 0, OFF64_HI_LO(offset)) +# elif __WORDSIZE == 32 +static _syscall5(ssize_t, __syscall_pread, int, fd, void *, buf, + size_t, count, off_t, offset_hi, off_t, offset_lo) +# define MY_PREAD(fd, buf, count, offset) __syscall_pread(fd, buf, count, OFF_HI_LO(offset)) +# define MY_PREAD64(fd, buf, count, offset) __syscall_pread(fd, buf, count, OFF64_HI_LO(offset)) +# else +static _syscall4(ssize_t, __syscall_pread, int, fd, void *, buf, + size_t, count, off_t, offset) +# define MY_PREAD(fd, buf, count, offset) __syscall_pread(fd, buf, count, offset) +# define MY_PREAD64(fd, buf, count, offset) __syscall_pread(fd, buf, count, offset) +# endif +# endif +#endif -#if defined(__UCLIBC_SYSCALL_ALIGN_64BIT__) -static __inline__ _syscall6(ssize_t, __syscall_pread, int, fd, void *, buf, - size_t, count, int, dummy, off_t, offset_hi, off_t, offset_lo) -# define __syscall_pread(fd, buf, count, ...) __syscall_pread(fd, buf, count, 0, __VA_ARGS__) -#else -static __inline__ _syscall5(ssize_t, __syscall_pread, int, fd, void *, buf, - size_t, count, off_t, offset_hi, off_t, offset_lo) +#ifndef MY_PWRITE +# ifdef __NR_pwrite +# define __NR___syscall_pwrite __NR_pwrite +# if defined(__UCLIBC_SYSCALL_ALIGN_64BIT__) +static _syscall6(ssize_t, __syscall_pwrite, int, fd, const void *, buf, + size_t, count, int, dummy, off_t, offset_hi, off_t, offset_lo) +# define MY_PWRITE(fd, buf, count, offset) __syscall_pwrite(fd, buf, count, 0, OFF_HI_LO(offset)) +# define MY_PWRITE64(fd, buf, count, offset) __syscall_pwrite(fd, buf, count, 0, OFF64_HI_LO(offset)) +# elif __WORDSIZE == 32 +static _syscall5(ssize_t, __syscall_pwrite, int, fd, const void *, buf, + size_t, count, off_t, offset_hi, off_t, offset_lo) +# define MY_PWRITE(fd, buf, count, offset) __syscall_pwrite(fd, buf, count, OFF_HI_LO(offset)) +# define MY_PWRITE64(fd, buf, count, offset) __syscall_pwrite(fd, buf, count, OFF64_HI_LO(offset)) +# else +static _syscall4(ssize_t, __syscall_pwrite, int, fd, const void *, buf, + size_t, count, off_t, offset) +# define MY_PWRITE(fd, buf, count, offset) __syscall_pwrite(fd, buf, count, offset) +# define MY_PWRITE64(fd, buf, count, offset) __syscall_pwrite(fd, buf, count, offset) +# endif +# endif #endif ssize_t __libc_pread(int fd, void *buf, size_t count, off_t offset) { int oldtype = LIBC_CANCEL_ASYNC (); - int result = __syscall_pread(fd, buf, count, __LONG_LONG_PAIR(offset >> 31, offset)); + int result = MY_PREAD(fd, buf, count, offset); LIBC_CANCEL_RESET (oldtype); return result; } weak_alias(__libc_pread,pread) -# ifdef __UCLIBC_HAS_LFS__ -ssize_t __libc_pread64(int fd, void *buf, size_t count, off64_t offset) +ssize_t __libc_pwrite(int fd, const void *buf, size_t count, off_t offset) { - uint32_t low = offset & 0xffffffff; - uint32_t high = offset >> 32; int oldtype = LIBC_CANCEL_ASYNC (); - int result = __syscall_pread(fd, buf, count, __LONG_LONG_PAIR(high, low)); + int result = MY_PWRITE(fd, buf, count, offset); LIBC_CANCEL_RESET (oldtype); return result; } -weak_alias(__libc_pread64,pread64) -# endif /* __UCLIBC_HAS_LFS__ */ - -#ifdef __NR_pwrite64 /* Newer kernels renamed but it's the same. */ -# undef __NR_pwrite -# define __NR_pwrite __NR_pwrite64 -#endif - -# define __NR___syscall_pwrite __NR_pwrite -#if defined(__UCLIBC_SYSCALL_ALIGN_64BIT__) -static __inline__ _syscall6(ssize_t, __syscall_pwrite, int, fd, const void *, buf, - size_t, count, int, dummy, off_t, offset_hi, off_t, offset_lo) -# define __syscall_pwrite(fd, buf, count, ...) __syscall_pwrite(fd, buf, count, 0, __VA_ARGS__) -#else -static __inline__ _syscall5(ssize_t, __syscall_pwrite, int, fd, const void *, buf, - size_t, count, off_t, offset_hi, off_t, offset_lo) -#endif +weak_alias(__libc_pwrite,pwrite) -ssize_t __libc_pwrite(int fd, const void *buf, size_t count, off_t offset) +#ifdef __UCLIBC_HAS_LFS__ +# if __WORDSIZE == 32 +ssize_t __libc_pread64(int fd, void *buf, size_t count, off64_t offset) { int oldtype = LIBC_CANCEL_ASYNC (); - int result = __syscall_pwrite(fd, buf, count, __LONG_LONG_PAIR(offset >> 31, offset)); + int result = MY_PREAD64(fd, buf, count, offset); LIBC_CANCEL_RESET (oldtype); return result; } -weak_alias(__libc_pwrite,pwrite) +weak_alias(__libc_pread64,pread64) -# ifdef __UCLIBC_HAS_LFS__ ssize_t __libc_pwrite64(int fd, const void *buf, size_t count, off64_t offset) { - uint32_t low = offset & 0xffffffff; - uint32_t high = offset >> 32; int oldtype = LIBC_CANCEL_ASYNC (); - int result = __syscall_pwrite(fd, buf, count, __LONG_LONG_PAIR(high, low)); + int result = MY_PWRITE64(fd, buf, count, offset); LIBC_CANCEL_RESET (oldtype); return result; } weak_alias(__libc_pwrite64,pwrite64) -# endif /* __UCLIBC_HAS_LFS__ */ + +# else +# ifdef __LINUXTHREADS_OLD__ +weak_alias(pread,pread64) +weak_alias(pwrite,pwrite64) +extern __typeof(pread64) __libc_pread64; +extern __typeof(pwrite64) __libc_pwrite4; +strong_alias(pread64,__libc_pread64) +strong_alias(pwrite64,__libc_write64) +# else +strong_alias_untyped(pread,pread64) +strong_alias_untyped(pwrite,pwrite64) +# endif +# endif +#endif From rep.dot.nop at gmail.com Wed May 20 10:26:26 2015 From: rep.dot.nop at gmail.com (Bernhard Reutner-Fischer) Date: Wed, 20 May 2015 12:26:26 +0200 Subject: [git commit] siginfo: add signal info for seccomp related SIGSYS Message-ID: <20150520102833.B36DA81DEA@busybox.osuosl.org> commit: http://git.uclibc.org/uClibc/commit/?id=274f3c84562cbba1d99bab2d085d22d8aa401a4e branch: http://git.uclibc.org/uClibc/commit/?id=refs/heads/master uClibc doesn't define signal info for the SIGSYS signal which is issued in case of hitting a syscall prohibited by seccomp. This is sad as it makes debugging seccomp filter policies impossible on some architectures (at least ARM and PowerPC, maybe also others) which do not coincidentally set si_value.sival_int as the syscall number. To fix this, import the definitions and macros needed from glibc. Signed-off-by: Daniel Golle Signed-off-by: Bernhard Reutner-Fischer --- libc/sysdeps/linux/alpha/bits/siginfo.h | 11 +++++++++++ libc/sysdeps/linux/common/bits/siginfo.h | 11 +++++++++++ libc/sysdeps/linux/ia64/bits/siginfo.h | 11 +++++++++++ libc/sysdeps/linux/mips/bits/siginfo.h | 11 +++++++++++ libc/sysdeps/linux/sparc/bits/siginfo.h | 11 +++++++++++ 5 files changed, 55 insertions(+), 0 deletions(-) diff --git a/libc/sysdeps/linux/alpha/bits/siginfo.h b/libc/sysdeps/linux/alpha/bits/siginfo.h index 0a37ad0..7e476aa 100644 --- a/libc/sysdeps/linux/alpha/bits/siginfo.h +++ b/libc/sysdeps/linux/alpha/bits/siginfo.h @@ -97,6 +97,14 @@ typedef struct siginfo int si_band; /* Band event for SIGPOLL. */ int si_fd; } _sigpoll; + + /* SIGSYS. */ + struct + { + void *_call_addr; /* Calling user insn. */ + int _syscall; /* Triggering system call number. */ + unsigned int _arch; /* AUDIT_ARCH_* of syscall. */ + } _sigsys; } _sifields; } siginfo_t; @@ -115,6 +123,9 @@ typedef struct siginfo # define si_addr _sifields._sigfault.si_addr # define si_band _sifields._sigpoll.si_band # define si_fd _sifields._sigpoll.si_fd +# define si_call_addr _sifields._sigsys._call_addr +# define si_syscall _sifields._sigsys._syscall +# define si_arch _sifields._sigsys._arch /* Values for `si_code'. Positive values are reserved for kernel-generated diff --git a/libc/sysdeps/linux/common/bits/siginfo.h b/libc/sysdeps/linux/common/bits/siginfo.h index c26e066..724f756 100644 --- a/libc/sysdeps/linux/common/bits/siginfo.h +++ b/libc/sysdeps/linux/common/bits/siginfo.h @@ -103,6 +103,14 @@ typedef struct siginfo long int si_band; /* Band event for SIGPOLL. */ int si_fd; } _sigpoll; + + /* SIGSYS. */ + struct + { + void *_call_addr; /* Calling user insn. */ + int _syscall; /* Triggering system call number. */ + unsigned int _arch; /* AUDIT_ARCH_* of syscall. */ + } _sigsys; } _sifields; } siginfo_t; @@ -121,6 +129,9 @@ typedef struct siginfo # define si_addr _sifields._sigfault.si_addr # define si_band _sifields._sigpoll.si_band # define si_fd _sifields._sigpoll.si_fd +# define si_call_addr _sifields._sigsys._call_addr +# define si_syscall _sifields._sigsys._syscall +# define si_arch _sifields._sigsys._arch /* Values for `si_code'. Positive values are reserved for kernel-generated diff --git a/libc/sysdeps/linux/ia64/bits/siginfo.h b/libc/sysdeps/linux/ia64/bits/siginfo.h index 3ac988b..df18b36 100644 --- a/libc/sysdeps/linux/ia64/bits/siginfo.h +++ b/libc/sysdeps/linux/ia64/bits/siginfo.h @@ -102,6 +102,14 @@ typedef struct siginfo long int si_band; /* Band event for SIGPOLL. */ int si_fd; } _sigpoll; + + /* SIGSYS. */ + struct + { + void *_call_addr; /* Calling user insn. */ + int _syscall; /* Triggering system call number. */ + unsigned int _arch; /* AUDIT_ARCH_* of syscall. */ + } _sigsys; } _sifields; } siginfo_t; @@ -120,6 +128,9 @@ typedef struct siginfo # define si_addr _sifields._sigfault.si_addr # define si_band _sifields._sigpoll.si_band # define si_fd _sifields._sigpoll.si_fd +# define si_call_addr _sifields._sigsys._call_addr +# define si_syscall _sifields._sigsys._syscall +# define si_arch _sifields._sigsys._arch # ifdef __USE_GNU # define si_imm _sifields._sigfault._si_imm diff --git a/libc/sysdeps/linux/mips/bits/siginfo.h b/libc/sysdeps/linux/mips/bits/siginfo.h index 5199d4d..b204301 100644 --- a/libc/sysdeps/linux/mips/bits/siginfo.h +++ b/libc/sysdeps/linux/mips/bits/siginfo.h @@ -108,6 +108,14 @@ typedef struct siginfo long int si_band; /* Band event for SIGPOLL. */ int si_fd; } _sigpoll; + + /* SIGSYS. */ + struct + { + void *_call_addr; /* Calling user insn. */ + int _syscall; /* Triggering system call number. */ + unsigned int _arch; /* AUDIT_ARCH_* of syscall. */ + } _sigsys; } _sifields; } siginfo_t; @@ -127,6 +135,9 @@ typedef struct siginfo # define si_addr_lsb _sifields._sigfault.si_addr_lsb # define si_band _sifields._sigpoll.si_band # define si_fd _sifields._sigpoll.si_fd +# define si_call_addr _sifields._sigsys._call_addr +# define si_syscall _sifields._sigsys._syscall +# define si_arch _sifields._sigsys._arch /* Values for `si_code'. Positive values are reserved for kernel-generated diff --git a/libc/sysdeps/linux/sparc/bits/siginfo.h b/libc/sysdeps/linux/sparc/bits/siginfo.h index 3ffeb6d..da1c838 100644 --- a/libc/sysdeps/linux/sparc/bits/siginfo.h +++ b/libc/sysdeps/linux/sparc/bits/siginfo.h @@ -104,6 +104,14 @@ typedef struct siginfo int si_band; /* Band event for SIGPOLL. */ int si_fd; } _sigpoll; + + /* SIGSYS. */ + struct + { + void *_call_addr; /* Calling user insn. */ + int _syscall; /* Triggering system call number. */ + unsigned int _arch; /* AUDIT_ARCH_* of syscall. */ + } _sigsys; } _sifields; } siginfo_t; @@ -123,6 +131,9 @@ typedef struct siginfo # define si_trapno _sifields._sigfault.si_trapno # define si_band _sifields._sigpoll.si_band # define si_fd _sifields._sigpoll.si_fd +# define si_call_addr _sifields._sigsys._call_addr +# define si_syscall _sifields._sigsys._syscall +# define si_arch _sifields._sigsys._arch /* Values for `si_code'. Positive values are reserved for kernel-generated From rep.dot.nop at gmail.com Tue May 26 19:59:19 2015 From: rep.dot.nop at gmail.com (Bernhard Reutner-Fischer) Date: Tue, 26 May 2015 21:59:19 +0200 Subject: [git commit] h8300: 64bit integer support Message-ID: <20150526202242.27E46817D4@busybox.osuosl.org> commit: http://git.uclibc.org/uClibc/commit/?id=62775f4518169222d70d9ba2465e938df236aef9 branch: http://git.uclibc.org/uClibc/commit/?id=refs/heads/master Signed-off-by: Yoshinori Sato Signed-off-by: Bernhard Reutner-Fischer --- include/stdint.h | 10 ---------- 1 files changed, 0 insertions(+), 10 deletions(-) diff --git a/include/stdint.h b/include/stdint.h index b134925..9ca8445 100644 --- a/include/stdint.h +++ b/include/stdint.h @@ -238,7 +238,6 @@ typedef unsigned long long int uintmax_t; # endif -#if !defined(__H8300H__) && !defined(__H8300S__) /* Minimum for largest signed integral type. */ # define INTMAX_MIN (-__INT64_C(9223372036854775807)-1) /* Maximum for largest signed integral type. */ @@ -246,15 +245,6 @@ typedef unsigned long long int uintmax_t; /* Maximum for largest unsigned integral type. */ # define UINTMAX_MAX (__UINT64_C(18446744073709551615)) -#else -/* Minimum for largest signed integral type. */ -# define INTMAX_MIN (-LONG_LONG_MAX-1) -/* Maximum for largest signed integral type. */ -# define INTMAX_MAX (LONG_LONG_MAX) - -/* Maximum for largest unsigned integral type. */ -# define UINTMAX_MAX (LONG_LONG_MAX<<1+1) -#endif /* Limits of other integer types. */ From rep.dot.nop at gmail.com Tue May 26 20:15:35 2015 From: rep.dot.nop at gmail.com (Bernhard Reutner-Fischer) Date: Tue, 26 May 2015 22:15:35 +0200 Subject: [git commit] h8300: Add new feature Message-ID: <20150526202242.42A6881D56@busybox.osuosl.org> commit: http://git.uclibc.org/uClibc/commit/?id=8c79e4541e1258220be822670b22b1b9572e70a8 branch: http://git.uclibc.org/uClibc/commit/?id=refs/heads/master Signed-off-by: Yoshinori Sato Signed-off-by: Bernhard Reutner-Fischer --- ldso/ldso/h8300/dl-sysdep.h | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/ldso/ldso/h8300/dl-sysdep.h b/ldso/ldso/h8300/dl-sysdep.h new file mode 100644 index 0000000..880d048 --- /dev/null +++ b/ldso/ldso/h8300/dl-sysdep.h @@ -0,0 +1 @@ +/* dl not supported */ From rep.dot.nop at gmail.com Tue May 26 20:20:12 2015 From: rep.dot.nop at gmail.com (Bernhard Reutner-Fischer) Date: Tue, 26 May 2015 22:20:12 +0200 Subject: [git commit] h8300: Makefile update Message-ID: <20150526202242.4B6E281D58@busybox.osuosl.org> commit: http://git.uclibc.org/uClibc/commit/?id=e158f13f3d80bd7a4e85c026a30fc85e06beb368 branch: http://git.uclibc.org/uClibc/commit/?id=refs/heads/master Signed-off-by: Yoshinori Sato Signed-off-by: Bernhard Reutner-Fischer --- libc/sysdeps/linux/h8300/Makefile | 70 ++++--------------------------- libc/sysdeps/linux/h8300/Makefile.arch | 10 +++++ 2 files changed, 19 insertions(+), 61 deletions(-) diff --git a/libc/sysdeps/linux/h8300/Makefile b/libc/sysdeps/linux/h8300/Makefile index 2ab4ee6..5524623 100644 --- a/libc/sysdeps/linux/h8300/Makefile +++ b/libc/sysdeps/linux/h8300/Makefile @@ -1,65 +1,13 @@ # Makefile for uClibc # -# Copyright (C) 2000-2006 Erik Andersen +# Copyright (C) 2015 Yoshinori Sato +# +# Licensed under the LGPL v2.1 or later, see the file COPYING.LIB in this tarball. # -# Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball. - -TOPDIR=../../../../ -include $(TOPDIR)Rules.mak -ifeq ($(DOPIC),y) -# is this not provided by gcc ? -ASFLAGS+=-D__PIC__ -endif - -#FIXME -- this arch should include its own crti.S and crtn.S -UCLIBC_CTOR_DTOR=n - -CRT_SRC := crt0.S -CRT_OBJ := crt0.o crt1.o -CTOR_TARGETS := $(TOPDIR)lib/crti.o $(TOPDIR)lib/crtn.o - -SSRC := __longjmp.S bsd-_setjmp.S bsd-setjmp.S clone.S setjmp.S vfork.S -SOBJ := $(patsubst %.S,%.o, $(SSRC)) - -CSRC := ptrace.c brk.c -COBJ := $(patsubst %.c,%.o, $(CSRC)) - -OBJS := $(SOBJ) $(COBJ) - -OBJ_LIST := ../../../obj.sysdeps.$(TARGET_ARCH) - -all: $(OBJ_LIST) $(CTOR_TARGETS) - -$(OBJ_LIST): $(OBJS) $(CRT_OBJ) - $(STRIPTOOL) -x -R .note -R .comment $^ - $(INSTALL) -d $(TOPDIR)lib/ - cp $(CRT_OBJ) $(TOPDIR)lib/ - echo $(patsubst %, sysdeps/linux/$(TARGET_ARCH)/%, $(OBJS)) > $@ - -$(CRT_OBJ): $(CRT_SRC) - $(CC) $(ASFLAGS) -DL_$* $< -c -o $*.o - -$(SOBJ): %.o : %.S - $(CC) $(ASFLAGS) -c $< -o $@ - -$(COBJ): %.o : %.c - $(CC) $(CFLAGS) -c $< -o $@ - -ifeq ($(UCLIBC_CTOR_DTOR),y) -$(TOPDIR)lib/crti.o: crti.S - $(INSTALL) -d $(TOPDIR)lib/ - $(CC) $(ASFLAGS) $(SSP_DISABLE_FLAGS) -c $< -o $@ - -$(TOPDIR)lib/crtn.o: crtn.S - $(INSTALL) -d $(TOPDIR)lib/ - $(CC) $(ASFLAGS) $(SSP_DISABLE_FLAGS) -c $< -o $@ -else -$(CTOR_TARGETS): - $(INSTALL) -d $(TOPDIR)lib/ - $(AR) $(ARFLAGS) $@ -endif - -headers: -clean: - $(RM) *.o *~ core +top_srcdir=../../../../ +top_builddir=../../../../ +all: objs +include $(top_builddir)Rules.mak +include Makefile.arch +include $(top_srcdir)Makerules diff --git a/libc/sysdeps/linux/h8300/Makefile.arch b/libc/sysdeps/linux/h8300/Makefile.arch new file mode 100644 index 0000000..371d3dd --- /dev/null +++ b/libc/sysdeps/linux/h8300/Makefile.arch @@ -0,0 +1,10 @@ +# Makefile for uClibc +# +# Copyright (C) 2015 Yoshinori Sato +# +# Licensed under the LGPL v2.1 or later, see the file COPYING.LIB in this tarball. +# + +CSRC-y := brk.c ptrace.c + +SSRC-y := __longjmp.S bsd-_setjmp.S bsd-setjmp.S clone.S setjmp.S vfork.S From rep.dot.nop at gmail.com Tue May 26 19:59:18 2015 From: rep.dot.nop at gmail.com (Bernhard Reutner-Fischer) Date: Tue, 26 May 2015 21:59:18 +0200 Subject: [git commit] h8300: config update Message-ID: <20150526202242.22AC981D58@busybox.osuosl.org> commit: http://git.uclibc.org/uClibc/commit/?id=7a8856c38c50a2790443bd2c03d5f4d4c8c36fe5 branch: http://git.uclibc.org/uClibc/commit/?id=refs/heads/master - New toolchain - Add new flags Signed-off-by: Yoshinori Sato Signed-off-by: Bernhard Reutner-Fischer --- Rules.mak | 5 ++--- extra/Configs/Config.h8300 | 5 +++-- extra/Configs/Config.in | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Rules.mak b/Rules.mak index aa2e3a7..de9ffb3 100644 --- a/Rules.mak +++ b/Rules.mak @@ -455,9 +455,8 @@ ifeq ($(TARGET_ARCH),sh64) endif ifeq ($(TARGET_ARCH),h8300) - SYMBOL_PREFIX=_ - CPU_LDFLAGS-$(CONFIG_H8300H)+= -Wl,-ms8300h - CPU_LDFLAGS-$(CONFIG_H8S) += -Wl,-ms8300s + CPU_LDFLAGS-$(CONFIG_H8300H)+= -Wl,-mh8300h_linux + CPU_LDFLAGS-$(CONFIG_H8S) += -Wl,-mh8300s_linux CPU_CFLAGS-$(CONFIG_H8300H) += -mh -mint32 CPU_CFLAGS-$(CONFIG_H8S) += -ms -mint32 endif diff --git a/extra/Configs/Config.h8300 b/extra/Configs/Config.h8300 index 458851b..0c5486c 100644 --- a/extra/Configs/Config.h8300 +++ b/extra/Configs/Config.h8300 @@ -10,9 +10,10 @@ config TARGET_ARCH config FORCE_OPTIONS_FOR_ARCH bool default y - select ARCH_ANY_ENDIAN + select ARCH_BIG_ENDIAN select ARCH_HAS_NO_MMU - select ARCH_HAS_DEPRECATED_SYSCALLS + select ARCH_HAS_NO_LDSO + select HAVE_NO_PIC choice prompt "Target Processor" diff --git a/extra/Configs/Config.in b/extra/Configs/Config.in index 1fd6860..242e45a 100644 --- a/extra/Configs/Config.in +++ b/extra/Configs/Config.in @@ -73,7 +73,7 @@ config TARGET_frv bool "frv (BROKEN)" config TARGET_h8300 - bool "h8300 (BROKEN)" + bool "h8300" config TARGET_hppa bool "hppa" From rep.dot.nop at gmail.com Tue May 26 20:15:26 2015 From: rep.dot.nop at gmail.com (Bernhard Reutner-Fischer) Date: Tue, 26 May 2015 22:15:26 +0200 Subject: [git commit] h8300: Assembly functions Message-ID: <20150526202242.2DB9E81D56@busybox.osuosl.org> commit: http://git.uclibc.org/uClibc/commit/?id=5e3820a8c616be4eaa1bdd1a55a713cb3a564537 branch: http://git.uclibc.org/uClibc/commit/?id=refs/heads/master - remove symbol prefix - new startup - new clone syscall support Signed-off-by: Yoshinori Sato Signed-off-by: Bernhard Reutner-Fischer --- libc/sysdeps/linux/h8300/__longjmp.S | 6 +- libc/sysdeps/linux/h8300/bsd-_setjmp.S | 10 +++-- libc/sysdeps/linux/h8300/bsd-setjmp.S | 13 +++--- libc/sysdeps/linux/h8300/clone.S | 36 ++++++++++++----- libc/sysdeps/linux/h8300/{crt0.S => crt1.S} | 38 +++++++++++++++---- libc/sysdeps/linux/h8300/crti.S | 8 ++-- libc/sysdeps/linux/h8300/crtn.S | 4 +- libc/sysdeps/linux/h8300/setjmp.S | 4 +- libc/sysdeps/linux/h8300/vfork.S | 54 ++++++++++++++++++++------ 9 files changed, 120 insertions(+), 53 deletions(-) diff --git a/libc/sysdeps/linux/h8300/__longjmp.S b/libc/sysdeps/linux/h8300/__longjmp.S index eb433df..bcb0985 100644 --- a/libc/sysdeps/linux/h8300/__longjmp.S +++ b/libc/sysdeps/linux/h8300/__longjmp.S @@ -4,10 +4,10 @@ .h8300h #endif .text - -.global ___longjmp -___longjmp: +.global __longjmp + +__longjmp: mov.l er1,er1 bne 1f sub.l er1,er1 diff --git a/libc/sysdeps/linux/h8300/bsd-_setjmp.S b/libc/sysdeps/linux/h8300/bsd-_setjmp.S index fbe7025..766d9cc 100644 --- a/libc/sysdeps/linux/h8300/bsd-_setjmp.S +++ b/libc/sysdeps/linux/h8300/bsd-_setjmp.S @@ -1,4 +1,4 @@ -/* BSD `_setjmp' entry point to `sigsetjmp (..., 0)'. H8/300 version. */ +/* BSD `_setjmp' entry point to `sigsetjmp (..., 0)'. H8/300 version. */ #include @@ -8,10 +8,10 @@ .h8300h #endif .text - -.global __setjmp -__setjmp: +.global _setjmp + +_setjmp: add.l #JB_SIZE,er0 mov.l @sp,er1 ; return PC mov.l er1, at -er0 @@ -23,3 +23,5 @@ __setjmp: sub.l er0,er0 mov.l er0,@(JB_SIZE:16,er1) rts + + .end diff --git a/libc/sysdeps/linux/h8300/bsd-setjmp.S b/libc/sysdeps/linux/h8300/bsd-setjmp.S index 74ebb8f..77c810f 100644 --- a/libc/sysdeps/linux/h8300/bsd-setjmp.S +++ b/libc/sysdeps/linux/h8300/bsd-setjmp.S @@ -1,4 +1,4 @@ -/* BSD `_setjmp' entry point to `sigsetjmp (..., 1)'. H8/300 version. */ +/* BSD `_setjmp' entry point to `sigsetjmp (..., 1)'. H8/300 version. */ #include @@ -8,10 +8,10 @@ .h8300h #endif .text - -.global _setjmp -_setjmp: +.global setjmp + +setjmp: add.l #JB_SIZE,er0 mov.l @sp,er1 ; return PC mov.l er1, at -er0 @@ -21,8 +21,9 @@ _setjmp: mov.l er4, at -er0 sub.l er0,er0 #if !defined(__PIC__) - jmp @___sigjmp_save + jmp @__sigjmp_save #else - mov.l @(___sigjmp_save at GOTOFF,er5),er1 + mov.l @(__sigjmp_save at GOTOFF,er5),er1 jmp @er3 #endif + .end diff --git a/libc/sysdeps/linux/h8300/clone.S b/libc/sysdeps/linux/h8300/clone.S index 554a297..a00eba4 100644 --- a/libc/sysdeps/linux/h8300/clone.S +++ b/libc/sysdeps/linux/h8300/clone.S @@ -1,5 +1,4 @@ -/* Adapted from glibc */ -/* Copyright (C) 1996, 1997 Free Software Foundation, Inc. */ +/* Copyright 2015 Yoshinori Sato */ /* clone is even more special than fork as it mucks with stacks and invokes a function in the right context after its all over. */ @@ -8,7 +7,8 @@ #include #include -/* int _clone(int (*fn)(void *arg), void *child_stack, int flags, void *arg); */ +/* int _clone(int (*fn)(void *arg), void *child_stack, int flags, void *arg + void *parent_tidptr, void *tls, void *child_tidptr) */ #ifdef __H8300H__ .h8300h @@ -18,8 +18,8 @@ #endif .text -.globl _clone -_clone: +.globl clone +clone: /* Sanity check arguments. */ mov.l #-EINVAL,er3 mov.l er0,er0 /* no NULL function pointers */ @@ -31,13 +31,25 @@ _clone: mov.l @(4:16,sp),er3 mov.l er3, at -er1 - /* Do the system call */ + /* setup argument */ mov.l er0,er3 /* er3 = child entry */ - mov.l er1,er0 - mov.l er2,er1 /* er1 = flags */ - mov.l er0,er2 /* er2 = child sp */ - mov.l #__NR_clone,r0 + sub.l #20,sp + mov.l er2, at sp /* flags */ + mov.l er1,@(4,sp) /* new sp */ + mov.l sp,er1 + mov.l @(20+8,sp),er0 + mov.l er0, at er1 /* parent tid */ + adds #4,er1 + mov.l @(20+16,sp),er0 + mov.l er0, at er1 /* child tid */ + adds #4,er1 + mov.l @(20+12,sp),er0 + mov.l er0, at er1 /* tls */ + /* do the system call */ + mov.l sp,er1 + mov.l #__NR_clone,er0 trapa #0 + add.l #20,sp mov.l er0,er0 bmi __syscall_error beq thread_start @@ -62,7 +74,9 @@ __syscall_error: thread_start: mov.l @sp+,er0 /* restore args */ - jsr @er3 + jsr @er3 mov.l er0,er1 mov.l #__NR_exit,er0 trapa #0 + + .end diff --git a/libc/sysdeps/linux/h8300/crt0.S b/libc/sysdeps/linux/h8300/crt1.S similarity index 66% rename from libc/sysdeps/linux/h8300/crt0.S rename to libc/sysdeps/linux/h8300/crt1.S index be6768d..847872a 100644 --- a/libc/sysdeps/linux/h8300/crt0.S +++ b/libc/sysdeps/linux/h8300/crt1.S @@ -28,17 +28,39 @@ not, see . */ #else .h8300h #endif +/* +void __uClibc_main(int (*main)(int, char **, char **), int argc, + char **argv, void (*app_init)(void), void (*app_fini)(void), + void (*rtld_fini)(void),void *stack_end attribute_unused) +*/ .text _start: /* put here so that references to _start work with elf-PIC */ - mov.l @(0,sp),er0 /* argc */ - mov.l @(4,sp),er1 /* argv */ - mov.l @(8,sp),er2 /* envp */ + mov.l @sp+,er1 /* argc */ + mov.l @sp+,er2 /* argv */ + add.l #4,sp + #if !defined(__PIC__) - jsr @___uClibc_main + mov.l sp, @-sp + sub.l er0,er0 + mov.l er0, at -sp + mov.l #_fini,er0 + mov.l er0, at -sp + mov.l #_init,er0 + mov.l er0, at -sp + mov.l #main,er0 + jsr @__uClibc_main #else - mov.l @(___uClibc_main at GOTOFF,er5),er3 + mov.l sp, @-sp + sub.l er0,er0 + mov.l er0, at -sp + mov.l @(_fini at GOTOFF,er5),er0 + mov.l er0, at -sp + mov.l @(_init at GOTOFF,er5),er0 + mov.l er0, at -sp + mov.l @(main at GOTOFF,er5),er0 + mov.l @(__uClibc_main at GOTOFF,er5),er3 jsr @er3 #endif @@ -61,9 +83,9 @@ empty_func: /* Define a symbol for the first piece of initialized data. */ .data - .globl __data_start -__data_start: + .globl _data_start +_data_start: .long 0 .weak data_start - data_start = __data_start + data_start = _data_start diff --git a/libc/sysdeps/linux/h8300/crti.S b/libc/sysdeps/linux/h8300/crti.S index 270df27..cc6afe9 100644 --- a/libc/sysdeps/linux/h8300/crti.S +++ b/libc/sysdeps/linux/h8300/crti.S @@ -10,8 +10,8 @@ .section .init ; #NO_APP .align 1 - .global __init -__init: + .global _init +_init: mov.l er6, at -er7 mov.l er7,er6 ; #APP @@ -20,8 +20,8 @@ __init: .section .fini ; #NO_APP .align 1 - .global __fini -__fini: + .global _fini +_fini: mov.l er6, at -er7 mov.l er7,er6 ; #APP diff --git a/libc/sysdeps/linux/h8300/crtn.S b/libc/sysdeps/linux/h8300/crtn.S index 8f9fa1f..a390704 100644 --- a/libc/sysdeps/linux/h8300/crtn.S +++ b/libc/sysdeps/linux/h8300/crtn.S @@ -10,7 +10,7 @@ .section .init ; #NO_APP .align 1 - .global __init + .global _init ; #NO_APP mov.l @er7+,er6 rts @@ -19,7 +19,7 @@ .section .fini ; #NO_APP .align 1 - .global __fini + .global _fini ; #NO_APP mov.l @er7+,er6 rts diff --git a/libc/sysdeps/linux/h8300/setjmp.S b/libc/sysdeps/linux/h8300/setjmp.S index f2795fa..0b8f052 100644 --- a/libc/sysdeps/linux/h8300/setjmp.S +++ b/libc/sysdeps/linux/h8300/setjmp.S @@ -7,9 +7,9 @@ #endif .text -.global ___sigsetjmp +.global __sigsetjmp -___sigsetjmp: +__sigsetjmp: add.l #JB_SIZE,er0 mov.l @sp,er1 ; return PC mov.l er1, at -er0 diff --git a/libc/sysdeps/linux/h8300/vfork.S b/libc/sysdeps/linux/h8300/vfork.S index 9b65f4f..1c70dd2 100644 --- a/libc/sysdeps/linux/h8300/vfork.S +++ b/libc/sysdeps/linux/h8300/vfork.S @@ -1,10 +1,7 @@ +/* Copyright 2002, 2015 Yoshinori Sato */ #include -#ifndef __NR_vfork -#define __NR_vfork __NR_fork /* uClinux-2.0 only has fork which is vfork */ -#endif - #ifdef __H8300S__ .h8300s #else @@ -12,29 +9,60 @@ #endif .text .align 2 - .globl ___vfork - .hidden ___vfork - .type ___vfork, at function -___vfork: + .globl __vfork + .hidden __vfork + .type __vfork, at function +__vfork: +#ifdef __NR_vfork mov.l @sp+, er1 sub.l er0,er0 mov.b #__NR_vfork,r0l trapa #0 + mov.l #-4096, er2 cmp.l er0,er2 bcs fix_errno - jmp @er1 /* don't return, just jmp directly */ + jmp @er1 /* don't return, just jmp directly */ fix_errno: neg.l er0 -#if !defined(__PIC__) +# if !defined(__PIC__) mov.l er0, at _errno -#else +# else mov.l @(_errno at GOTOFF,er5),er2 mov.l er0, at er2 -#endif +# endif sub.l er0,er0 dec.l #1,er0 - jmp @er1 /* don't return, just jmp directly */ + jmp @er1 /* don't return, just jmp directly */ +#else + mov.l @sp+,er2 /* er2 = return address */ + mov.l #vfork_args,er1 + sub.l er0,er0 + mov.b #__NR_clone,r0l + trapa #0 + mov.l #-4096,er1 + cmp.l er0,er1 + bcc done + neg.l er0 +# if !defined(__PIC__) + mov.l er0, at errno +# else + mov.l @(errno at GOTOFF,er5),er1 + mov.l er0, at er1 +# endif + sub.l er0,er0 + dec.l #1,er0 +done: + jmp @er2 + +vfork_args: + .long 0x80004100 /* CLONE_VFORK | CLONE_VM | SIGCHLD */ + .long 0 + .long 0 + .long 0 + .long 0 +#endif weak_alias(__vfork,vfork) libc_hidden_def(vfork) + .end From rep.dot.nop at gmail.com Tue May 26 20:15:35 2015 From: rep.dot.nop at gmail.com (Bernhard Reutner-Fischer) Date: Tue, 26 May 2015 22:15:35 +0200 Subject: [git commit] h8300: headers update Message-ID: <20150526202242.377AB81D9A@busybox.osuosl.org> commit: http://git.uclibc.org/uClibc/commit/?id=dc19aa547995f92b89449ed9ebb69ea08b2098ca branch: http://git.uclibc.org/uClibc/commit/?id=refs/heads/master - wire up new kernel Signed-off-by: Yoshinori Sato Signed-off-by: Bernhard Reutner-Fischer --- libc/sysdeps/linux/h8300/bits/byteswap.h | 15 +-- libc/sysdeps/linux/h8300/bits/fcntl.h | 7 +- libc/sysdeps/linux/h8300/bits/kernel_stat.h | 50 ----- libc/sysdeps/linux/h8300/bits/kernel_types.h | 13 ++ libc/sysdeps/linux/h8300/bits/syscalls.h | 214 +++++++------------- .../linux/h8300/bits/uClibc_arch_features.h | 2 +- 6 files changed, 95 insertions(+), 206 deletions(-) diff --git a/libc/sysdeps/linux/h8300/bits/byteswap.h b/libc/sysdeps/linux/h8300/bits/byteswap.h index 71a66c6..08ca99f 100644 --- a/libc/sysdeps/linux/h8300/bits/byteswap.h +++ b/libc/sysdeps/linux/h8300/bits/byteswap.h @@ -19,20 +19,7 @@ #ifndef _ASM_BITS_BYTESWAP_H #define _ASM_BITS_BYTESWAP_H 1 -#define __bswap_non_constant_32(x) \ - __extension__ \ - ({ unsigned int __v; \ - __asm__ __volatile__ ("mov.l %0,er0\n\t" \ - "mov.b r0l,r1h\n\t" \ - "mov.b r0h,r1l\n\t" \ - "mov.w r1,e1\n\t" \ - "mov.w e0,r0\n\t" \ - "mov.b r0l,r1h\n\t" \ - "mov.b r0h,r1l\n\t" \ - "mov.l er1,%0" \ - : "=d" (__v) \ - : "0" (x): "er0","er1"); \ - __v; }) +#define __bswap_non_constant_32(x) __builtin_bswap32(x) #endif diff --git a/libc/sysdeps/linux/h8300/bits/fcntl.h b/libc/sysdeps/linux/h8300/bits/fcntl.h index 45deec4..1c653be 100644 --- a/libc/sysdeps/linux/h8300/bits/fcntl.h +++ b/libc/sysdeps/linux/h8300/bits/fcntl.h @@ -22,6 +22,9 @@ #include +#ifdef __USE_GNU +# include +#endif /* open/fcntl - O_SYNC is only implemented on blocks devices and on files located on an ext2 file system */ @@ -42,8 +45,10 @@ #ifdef __USE_GNU # define O_DIRECTORY 040000 /* Must be a directory. */ -# define O_NOFOLLOW 0100000 /* Do not follow links. */ # define O_DIRECT 0200000 /* Direct disk access. */ +# define O_NOFOLLOW 0400000 /* Do not follow links. */ +# define O_NOATIME 01000000 /* Do not set atime. */ +# define O_CLOEXEC 02000000 /* Set close_on_exec. */ #endif /* For now Linux has synchronisity options for data and read operations. diff --git a/libc/sysdeps/linux/h8300/bits/kernel_stat.h b/libc/sysdeps/linux/h8300/bits/kernel_stat.h deleted file mode 100644 index 5f6c8ae..0000000 --- a/libc/sysdeps/linux/h8300/bits/kernel_stat.h +++ /dev/null @@ -1,50 +0,0 @@ -#ifndef _BITS_STAT_STRUCT_H -#define _BITS_STAT_STRUCT_H - -/* This file provides whatever this particular arch's kernel thinks - * struct kernel_stat should look like... It turns out each arch has a - * different opinion on the subject... */ - -struct kernel_stat { - unsigned short st_dev; - unsigned short __pad1; - unsigned long st_ino; - unsigned short st_mode; - unsigned short st_nlink; - unsigned short st_uid; - unsigned short st_gid; - unsigned short st_rdev; - unsigned short __pad2; - unsigned long st_size; - unsigned long st_blksize; - unsigned long st_blocks; - struct timespec st_atim; - struct timespec st_mtim; - struct timespec st_ctim; - unsigned long __unused4; - unsigned long __unused5; -}; - -struct kernel_stat64 { - unsigned long long st_dev; - unsigned char __pad1[2]; -#define _HAVE_STAT64___ST_INO - unsigned long __st_ino; - unsigned int st_mode; - unsigned int st_nlink; - unsigned long st_uid; - unsigned long st_gid; - unsigned short st_rdev; - unsigned char __pad3[10]; - long long st_size; - unsigned long st_blksize; - unsigned long st_blocks; /* Number 512-byte blocks allocated. */ - unsigned long __pad4; /* future possible st_blocks high bits */ - struct timespec st_atim; - struct timespec st_mtim; - struct timespec st_ctim; - unsigned long long st_ino; -}; - -#endif /* _BITS_STAT_STRUCT_H */ - diff --git a/libc/sysdeps/linux/h8300/bits/kernel_types.h b/libc/sysdeps/linux/h8300/bits/kernel_types.h index 4cfd1bf..7e76891 100644 --- a/libc/sysdeps/linux/h8300/bits/kernel_types.h +++ b/libc/sysdeps/linux/h8300/bits/kernel_types.h @@ -35,6 +35,18 @@ typedef __kernel_dev_t __kernel_old_dev_t; typedef long __kernel_long_t; typedef unsigned long __kernel_ulong_t; +#define __kernel_long_t __kernel_long_t +#define __kernel_ino_t __kernel_ino_t +#define __kernel_mode_t __kernel_mode_t +#define __kernel_pid_t __kernel_pid_t +#define __kernel_ipc_pid_t __kernel_ipc_pid_t +#define __kernel_uid_t __kernel_uid_t +#define __kernel_susecond_t __kernel_susecond_t +#define __kernel_daddr_t __kernel_daddr_t +#define __kernel_uid32_t __kernel_uid32_t +#define __kernel_old_uid_t __kernel_old_uid_t +#define __kernel_old_dev_t __kernel_old_dev_t + typedef struct { #ifdef __USE_ALL int val[2]; @@ -42,5 +54,6 @@ typedef struct { int __val[2]; #endif } __kernel_fsid_t; +#define __kernel_fsid_t __kernel_fsid_t #endif /* _BITS_KERNEL_TYPES_H */ diff --git a/libc/sysdeps/linux/h8300/bits/syscalls.h b/libc/sysdeps/linux/h8300/bits/syscalls.h index 5867ed6..b43795f 100644 --- a/libc/sysdeps/linux/h8300/bits/syscalls.h +++ b/libc/sysdeps/linux/h8300/bits/syscalls.h @@ -1,151 +1,85 @@ -/* Unlike the asm/unistd.h kernel header file (which this is partly based on), - * this file must be able to cope with PIC and non-PIC code. For some arches - * there is no difference. For x86 (which has far too few registers) there is - * a difference. Regardless, including asm/unistd.h is hereby officially - * forbidden. Don't do it. It is bad for you. - */ +#ifndef _BITS_SYSCALLS_H +#define _BITS_SYSCALLS_H #ifndef _SYSCALL_H # error "Never use directly; include instead." #endif -#define __syscall_return(type, res) \ -do { \ - if ((unsigned long)(res) >= (unsigned long)(-125)) { \ - /* avoid using res which is declared to be in register d0; \ - errno might expand to a function call and clobber it. */ \ - int __err = -(res); \ - errno = __err; \ - res = -1; \ - } \ - return (type) (res); \ -} while (0) +#ifndef __ASSEMBLER__ -#define _syscall0(type, name) \ -type name(void) \ -{ \ - register long __res __asm__("er0"); \ - __asm__ __volatile__ ("mov.l %1,er0\n\t" \ - "trapa #0\n\t" \ - : "=r" (__res) \ - : "ir" (__NR_##name) \ - : "cc"); \ - if ((unsigned long)(__res) >= (unsigned long)(-125)) { \ - errno = -__res; \ - __res = -1; \ - } \ - return (type)__res; \ -} +#include -#define _syscall1(type, name, atype, a) \ -type name(atype a) \ -{ \ - register long __res __asm__("er0"); \ - __asm__ __volatile__ ("mov.l %2, er1\n\t" \ - "mov.l %1, er0\n\t" \ - "trapa #0\n\t" \ - : "=r" (__res) \ - : "ir" (__NR_##name), \ - "g" ((long)a) \ - : "cc", "er1"); \ - if ((unsigned long)(__res) >= (unsigned long)(-125)) { \ - errno = -__res; \ - __res = -1; \ - } \ - return (type)__res; \ -} +#define ASMFMT_0 +#define ASMFMT_1 , "g"(er1) +#define ASMFMT_2 , "g"(er1), "g"(er2) +#define ASMFMT_3 , "g"(er1), "g"(er2), "g"(er3) +#define ASMFMT_4 , "g"(er1), "g"(er2), "g"(er3), "g"(er4) +#define ASMFMT_5 , "g"(er1), "g"(er2), "g"(er3), "g"(er4), "g"(er5) +#define ASMFMT_6 , "g"(er1), "g"(er2), "g"(er3), "g"(er4), "m"(er5), "m"(er6) -#define _syscall2(type, name, atype, a, btype, b) \ -type name(atype a, btype b) \ -{ \ - register long __res __asm__("er0"); \ - __asm__ __volatile__ ("mov.l %3, er2\n\t" \ - "mov.l %2, er1\n\t" \ - "mov.l %1, er0\n\t" \ - "trapa #0\n\t" \ - : "=r" (__res) \ - : "ir" (__NR_##name), \ - "g" ((long)a), \ - "g" ((long)b) \ - : "cc", "er1", "er2"); \ - if ((unsigned long)(__res) >= (unsigned long)(-125)) { \ - errno = -__res; \ - __res = -1; \ - } \ - return (type)__res; \ -} +#define SUBSTITUTE_ARGS_0() do {} while(0); +#define SUBSTITUTE_ARGS_1(arg1) \ + register long int er1 __asm__("er1") = (long int)arg1; +#define SUBSTITUTE_ARGS_2(arg1, arg2) \ + register long int er1 __asm__("er1") = (long int)arg1; \ + register long int er2 __asm__("er2") = (long int)arg2; +#define SUBSTITUTE_ARGS_3(arg1, arg2, arg3) \ + register long int er1 __asm__("er1") = (long int)arg1; \ + register long int er2 __asm__("er2") = (long int)arg2; \ + register long int er3 __asm__("er3") = (long int)arg3; +#define SUBSTITUTE_ARGS_4(arg1, arg2, arg3, arg4) \ + register long int er1 __asm__("er1") = (long int)arg1; \ + register long int er2 __asm__("er2") = (long int)arg2; \ + register long int er3 __asm__("er3") = (long int)arg3; \ + register long int er4 __asm__("er4") = (long int)arg4; +#define SUBSTITUTE_ARGS_5(arg1, arg2, arg3, arg4, arg5) \ + register long int er1 __asm__("er1") = (long int)arg1; \ + register long int er2 __asm__("er2") = (long int)arg2; \ + register long int er3 __asm__("er3") = (long int)arg3; \ + register long int er4 __asm__("er4") = (long int)arg4; \ + register long int er5 __asm__("er5") = (long int)arg5; +#define SUBSTITUTE_ARGS_6(arg1, arg2, arg3, arg4, arg5, arg6) \ + register long int er1 __asm__("er1") = (long int)arg1; \ + register long int er2 __asm__("er2") = (long int)arg2; \ + register long int er3 __asm__("er3") = (long int)arg3; \ + register long int er4 __asm__("er4") = (long int)arg4; \ + long int er5 = (long int)arg5; \ + long int er6 = (long int)arg6; -#define _syscall3(type, name, atype, a, btype, b, ctype, c) \ -type name(atype a, btype b, ctype c) \ -{ \ - register long __res __asm__("er0"); \ - __asm__ __volatile__ ("mov.l %4, er3\n\t" \ - "mov.l %3, er2\n\t" \ - "mov.l %2, er1\n\t" \ - "mov.l %1, er0\n\t" \ - "trapa #0\n\t" \ - : "=r" (__res) \ - : "ir" (__NR_##name), \ - "g" ((long)a), \ - "g" ((long)b), \ - "g" ((long)c) \ - : "cc", "er1", "er2", "er3"); \ - if ((unsigned long)(__res) >= (unsigned long)(-125)) { \ - errno = -__res; \ - __res = -1; \ - } \ - return (type)__res; \ -} +#define LOAD_ARGS_0 +#define LOAD_ARGS_1 +#define LOAD_ARGS_2 +#define LOAD_ARGS_3 +#define LOAD_ARGS_4 +#define LOAD_ARGS_5 +#define LOAD_ARGS_6 "mov.l er5, at -sp\n\tmov.l %6,er5\n\t" \ + "mov.l er6, at -sp\n\tmov.l %7,er6\n\t" -#define _syscall4(type, name, atype, a, btype, b, ctype, c, dtype, d) \ -type name(atype a, btype b, ctype c, dtype d) \ -{ \ - register long __res __asm__("er0"); \ - __asm__ __volatile__ ("mov.l %5, er4\n\t" \ - "mov.l %4, er3\n\t" \ - "mov.l %3, er2\n\t" \ - "mov.l %2, er1\n\t" \ - "mov.l %1, er0\n\t" \ - "trapa #0\n\t" \ - : "=r" (__res) \ - : "ir" (__NR_##name), \ - "g" ((long)a), \ - "g" ((long)b), \ - "g" ((long)c), \ - "g" ((long)d) \ - : "cc", "er1", "er2", "er3", "er4"); \ - if ((unsigned long)(__res) >= (unsigned long)(-125)) { \ - errno = -__res; \ - __res = -1; \ - } \ - return (type)__res; \ -} +#define RESTORE_ARGS_0 +#define RESTORE_ARGS_1 +#define RESTORE_ARGS_2 +#define RESTORE_ARGS_3 +#define RESTORE_ARGS_4 +#define RESTORE_ARGS_5 +#define RESTORE_ARGS_6 "mov.l @sp+,er6\n\tmov.l @sp+,er5" -#define _syscall5(type, name, atype, a, btype, b, ctype, c, dtype, d, etype, e) \ -type name(atype a, btype b, ctype c, dtype d, etype e) \ -{ \ - register long __res __asm__("er0"); \ - __asm__ __volatile__ ( \ - "mov.l er5, at -sp\n\t" \ - "mov.l %5, er4\n\t" \ - "mov.l %4, er3\n\t" \ - "mov.l %3, er2\n\t" \ - "mov.l %2, er1\n\t" \ - "mov.l %1, er0\n\t" \ - "mov.l %6, er5\n\t" \ - "trapa #0\n\t" \ - "mov.l @sp+,er5\n\t" \ - : "=r" (__res) \ - : "ir" (__NR_##name), \ - "g" ((long)a), \ - "g" ((long)b), \ - "g" ((long)c), \ - "g" ((long)d), \ - "m" ((long)e) \ - : "cc", "er1", "er2", "er3", "er4"); \ - if ((unsigned long)(__res) >= (unsigned long)(-125)) { \ - errno = -__res; \ - __res = -1; \ - } \ - return (type)__res; \ -} +/* The _NCS variant allows non-constant syscall numbers. */ +#define INTERNAL_SYSCALL_NCS(name, err, nr, args...) \ +(__extension__ \ + ({ \ + register long int er0 __asm__ ("er0"); \ + SUBSTITUTE_ARGS_##nr(args) \ + __asm__ __volatile__ ( \ + LOAD_ARGS_##nr \ + "mov.l %1,er0\n\t" \ + "trapa #0\n\t" \ + RESTORE_ARGS_##nr \ + : "=r" (er0) \ + : "ir" (name) ASMFMT_##nr \ + : "memory" \ + ); \ + (int) er0; \ + }) \ +) +#endif /* __ASSEMBLER__ */ +#endif /* _BITS_SYSCALLS_H */ diff --git a/libc/sysdeps/linux/h8300/bits/uClibc_arch_features.h b/libc/sysdeps/linux/h8300/bits/uClibc_arch_features.h index b76b861..fb430ae 100644 --- a/libc/sysdeps/linux/h8300/bits/uClibc_arch_features.h +++ b/libc/sysdeps/linux/h8300/bits/uClibc_arch_features.h @@ -43,6 +43,6 @@ #define __UCLIBC_HAVE_SIGNED_ZERO__ /* only weird assemblers generally need this */ -#undef __UCLIBC_ASM_LINE_SEP__ +#define __UCLIBC_ASM_LINE_SEP__ ! #endif /* _BITS_UCLIBC_ARCH_FEATURES_H */ From rep.dot.nop at gmail.com Tue May 26 20:22:00 2015 From: rep.dot.nop at gmail.com (Bernhard Reutner-Fischer) Date: Tue, 26 May 2015 22:22:00 +0200 Subject: [git commit] ARC: enable IPv6 in defconfigs Message-ID: <20150526202242.5471D81D56@busybox.osuosl.org> commit: http://git.uclibc.org/uClibc/commit/?id=c058c0578db7b036fabdda6f98be567232d00e6e branch: http://git.uclibc.org/uClibc/commit/?id=refs/heads/master These days IPv6 is used more and more in different software packages. And so we're adding IPv6 support by default in uClibc for ARC cores. Signed-off-by: Alexey Brodkin Cc: Vineet Gupta Cc: Anton Kolesov Signed-off-by: Bernhard Reutner-Fischer --- extra/Configs/defconfigs/arc/arcv2_defconfig | 1 + extra/Configs/defconfigs/arc/defconfig | 1 + 2 files changed, 2 insertions(+), 0 deletions(-) diff --git a/extra/Configs/defconfigs/arc/arcv2_defconfig b/extra/Configs/defconfigs/arc/arcv2_defconfig index 1e204aa..9e34694 100644 --- a/extra/Configs/defconfigs/arc/arcv2_defconfig +++ b/extra/Configs/defconfigs/arc/arcv2_defconfig @@ -19,6 +19,7 @@ UCLIBC_HAS_PROGRAM_INVOCATION_NAME=y UCLIBC_HAS_LIBUTIL=y UCLIBC_HAS_OBSOLETE_BSD_SIGNAL=y UCLIBC_SV4_DEPRECATED=y +UCLIBC_HAS_IPV6=y UCLIBC_HAS_RPC=y UCLIBC_HAS_FULL_RPC=y UCLIBC_USE_NETLINK=y diff --git a/extra/Configs/defconfigs/arc/defconfig b/extra/Configs/defconfigs/arc/defconfig index 994abeb..bd93696 100644 --- a/extra/Configs/defconfigs/arc/defconfig +++ b/extra/Configs/defconfigs/arc/defconfig @@ -18,6 +18,7 @@ UCLIBC_HAS_PROGRAM_INVOCATION_NAME=y UCLIBC_HAS_LIBUTIL=y UCLIBC_HAS_OBSOLETE_BSD_SIGNAL=y UCLIBC_SV4_DEPRECATED=y +UCLIBC_HAS_IPV6=y UCLIBC_HAS_RPC=y UCLIBC_HAS_FULL_RPC=y UCLIBC_USE_NETLINK=y From rep.dot.nop at gmail.com Thu May 28 15:05:43 2015 From: rep.dot.nop at gmail.com (Bernhard Reutner-Fischer) Date: Thu, 28 May 2015 17:05:43 +0200 Subject: [git commit] getconf.c: undef VERSION Message-ID: <20150529073854.0E41A81D6B@busybox.osuosl.org> commit: http://git.uclibc.org/uClibc/commit/?id=9930f8b92bb47b2dbea7679d948e3ecfbce23ca9 branch: http://git.uclibc.org/uClibc/commit/?id=refs/heads/master might come in via nptl so undef it before redefining it Signed-off-by: Bernhard Reutner-Fischer --- utils/getconf.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/utils/getconf.c b/utils/getconf.c index 408a574..3dd3d75 100644 --- a/utils/getconf.c +++ b/utils/getconf.c @@ -23,6 +23,7 @@ #include #define PACKAGE "getconf regression test" +#undef VERSION #define VERSION "" #define _(x) x #define error(status, errnum, fmt, ...) \ From bugzilla at busybox.net Sun May 31 03:47:56 2015 From: bugzilla at busybox.net (bugzilla at busybox.net) Date: Sun, 31 May 2015 03:47:56 +0000 (UTC) Subject: [Bug 8141] New: Pthreads multiple definition Message-ID: https://bugs.busybox.net/show_bug.cgi?id=8141 Summary: Pthreads multiple definition Product: uClibc Version: unspecified Platform: PC OS/Version: Linux Status: NEW Severity: minor Priority: P5 Component: Threads AssignedTo: unassigned at uclibc.org ReportedBy: ishitatsuyuki at gmail.com CC: uclibc-cvs at uclibc.org Estimated Hours: 0.0 setresuid.c:(.text+0x0): multiple definition of `setresuid' setresgid.c:(.text+0x0): multiple definition of `setresgid' Actually, we need to empty the 2 files to successfully link (at least staticlly). -- Configure bugmail: https://bugs.busybox.net/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.