uClibc-ng 1.0.29 release

2018-03-03 Thread Waldemar Brodkorb
Hi,

I released uClibc-ng 1.0.29 today.
The new release contains mostly bugfixes for aarch64 and x86_64.
I use Gentoo/uClibc-ng since some weeks and found some
Glibc compatibility issues. I run chromium every day on my
Lenovo X200 with lates uClibc-ng.
I integrated gettext-tiny, which allows to use uClibc-ng for
Desktop when compiling software with i18n requirements.

Attention: arc4random is removed.

best regards
 Waldemar

___
uClibc mailing list
uClibc@uclibc.org
http://lists.busybox.net/mailman/listinfo/uclibc


uClibc-ng release 1.0.27

2017-11-27 Thread Waldemar Brodkorb
Hi,

I released uClibc-ng 1.0.27 yesterday.

It adds support for c-sky architecture. 
Many thanks to Guo Ren!

Furthermore it contains a lot of or1k NPTL bugfixes,
which reduces the seen test failures running the uClibc-ng
testsuite inside Qemu a lot.
Many thanks to Stafford Horne! 

And a lot of other bugfixes.

Thanks to the many new contributors!

best regards
 Waldemar
___
uClibc mailing list
uClibc@uclibc.org
http://lists.busybox.net/mailman/listinfo/uclibc


uClibc-ng release 1.0.25

2017-06-11 Thread Waldemar Brodkorb
Hi,

I released a new version of uClibc-ng today.
It contains mostly bugfixes and cleanups.

It allows to be used for gcc 7.1 toolchains.

have fun,
 Waldemar



signature.asc
Description: Digital signature
___
uClibc mailing list
uClibc@uclibc.org
http://lists.busybox.net/mailman/listinfo/uclibc

new release 1.0.24

2017-04-22 Thread Waldemar Brodkorb
Hi embedded hackers,

I released 1.0.24 today. Mostly bugfixes and cleanups.
The aarch64 c++ issue is fixed and the long double wrappers
are available for all architectures now. (lvm2 build issues)

I removed old fnmatch/regex implementations to simplify the 
code base.

have fun,
 Waldemar



signature.asc
Description: Digital signature
___
uClibc mailing list
uClibc@uclibc.org
http://lists.busybox.net/mailman/listinfo/uclibc

uClibc-ng 1.0.23 released

2017-04-02 Thread Waldemar Brodkorb
Hi,

I released uClibc-ng 1.0.23 yesterday.
Mostly bugfixes. I have removed the internal RPC
implementation, which is mostly unusable nowadays
as most applications force libtirpc usage (like
rpcbind).

For nios2 I added some ld.so code with the help
of Thorsten, but it is still unusable.

best regards
 Waldemar

___
uClibc mailing list
uClibc@uclibc.org
http://lists.busybox.net/mailman/listinfo/uclibc


Re: About the support of aarch64

2017-03-15 Thread Waldemar Brodkorb
Hi,
Rob Landley wrote,

> On 01/09/2017 08:26 AM, ANDY KENNEDY wrote:
> > Because uClibc is dead.
> 
> As the guy who staged the coup to appoint the current maintainer a
> decade ago and then watched him _not_ get the NPTL mess sorted or the
> project back on a regular release schedule, I agree: uClibc is dead. Has
> been for a while, replaced by musl-libc (chromeos) and bionic (android).
> 
> I wrote a long eulogy for the project last year on the buildroot list
> explaining how it died and why I consider the uClibc-ng project to be
> beating a dead horse:

Yeah, but your opinion is just _one_ opinion.
Keeping a working code base up and running for a lot of
architectures not supported by musl isn't about beating a dead
horse.(ARC, Xtensa, NDS32, Sparc, Blackfin, C6X, H8/300, ..)
uClibc-ng is alive and kicking. So stop telling people bullshit.

>   http://lists.busybox.net/pipermail/buildroot/2016-December/180102.html
> 
> Of course that particular exercise in necromancy is no sillier than a
> half-dozen other such projects I could name.

Surely reimplementing a well known project like busybox just because
to use another open source license is something totally useful and
genius stuff.

I added aarchh64 support recently to uClibc-ng, so you might give it
a try and make your own opinion.

best regards
 Waldemar
___
uClibc mailing list
uClibc@uclibc.org
http://lists.busybox.net/mailman/listinfo/uclibc


new release 1.0.22

2017-02-01 Thread Waldemar Brodkorb
Hi,

I cut a new release today to get wider testing of the new stuff.

Most important stuff:
 - support for mips{32,64}r6 fixed
 - nds32 architecture port supports NPTL/TLS now
 - broken x86 syscall6 bug finally fixed
 - experimental support for aarch64 added
 - PID caching support removed, synced with GNU C library
 - some more bugfixes/features to support systemd

Have fun,
 Waldemar


signature.asc
Description: Digital signature
___
uClibc mailing list
uClibc@uclibc.org
http://lists.busybox.net/mailman/listinfo/uclibc

Re: About the support of aarch64

2017-01-10 Thread Waldemar Brodkorb
Hi,
郭哲洋 wrote,

> Does uclibc have any plan about supporting the aarch64 platform in the
> future? If not, what is the reason?

I have plans to support aarch64 in uClibc-ng.
Basic support (static/shared library) is ready.
To complete the porting I need to get NPTL/TLS ready.
I have more then 60 % for NPTL/TLS ready...

It is not pushed, yet.

best regards
 Waldemar
___
uClibc mailing list
uClibc@uclibc.org
http://lists.busybox.net/mailman/listinfo/uclibc

Re: [Buildroot] [musl] Re: [musl] cortex-m support?

2016-12-27 Thread Waldemar Brodkorb
Hi Rob,
Rob Landley wrote,

> On 12/21/2016 12:18 AM, Waldemar Brodkorb wrote:
> > Hi Rob,
> > Rob Landley wrote,
> 
> >>> I am wondering why you don't cc me or any uclibc related list? 
> >>
> >> I cc'd the buildroot list, which only has uClibc-based cortex-m support
> >> at the moment. Why do you suppose I did that?
> > 
> > That is not completely true, OpenADK has support for it, too.
> 
> Buildroot has cortex-m support based on OpenADK as well as its cortex-m
> support based on uClibc?

Yes, that is true. We found some problems with Linuxthreads and
could fix it upstream in elf2flt. Buildroot has furthermore good
support for STM32F29 devices. The Qemu-ARM noMMU default config was
contributed by me. OpenADK tries to support Kinetis K70 from
Emcraft, but it seems my compiler is to recent to compile their old
2.6.33 kernel correctly.
 
> Now I'm trying to turn Android into a self-hosting development
> environment ...

I dislike the hardware and closed source drivers. It is sad that
OpenMoko didn't evolved. People like me working on old crappy C
libraries, supporting crappy architectures and devices still own
such phones.
 
> Before either of those I spent half the 1990's trying to make OS/2
> happen (because windows was terrible technology and basing the internet
> on it meant not just a virus utopia but probably the kind of surveilance
> state Edward Snowden eventually showed us we actually got.) My time on
> OS/2 was a learning experience, and figuring out it was over and I
> needed to move on to Linux in 1998 was an important lesson. I prefer to
> spend my public development time on things that have at least the
> possibility of a future.

I started playing with Linux in nearly the same year. I think SuSE
Linux 5.2 was my first playground. 

> Maybe similarly persisting with uClibc will work out for you, I just
> don't see how. (I have no idea what you're trying to accomplish. What
> niche it has these days that musl, bionic, and (e)glibc _don't_ have.)

You will see, probably.
 
> You're accusing me of choosing not to spend my free time on uClibc
> anymore. I don't understand why this is some sort of accusation. There
> are 7 billion people on this planet ignoring you. My being among them is
> not an attack on your project. I pushed uClibc for 10 years (again, as a
> hobbyist). I stopped when Rich posted his libc archive somewhere public
> I could test and contribute to, which offered a better use of my time.

Yeah, but the 7 billion people don't blog or post bad propaganda
about uClibc-ng. But even bad talk about uClibc makes it alive ;)

> You're aware that half the point of my
> http://landley.net/aboriginal/about.html project was regression testing
> each new release under qemu to see what broke, right?

Yes, I am aware of it.
 
> Been there, done that. Doing other things now. The point is I am aware
> how much work proper regression testing is. I also believe there's no
> substitute for actual real-world use, and users other than the
> developers who will find stuff the developers never will. The cortex-m
> bug says to me that uClibc, on cortex-m, hasn't actually got serious
> users or you'd have noticed the problem yourself years ago.

I hope to get the Emcraft developers involved in uClibc-ng
development and make things better in the future. We will see.
 
> > Thanks for the history walkthrough. Do you know why Bernhard is so
> > unresponsive and more about the time shortly after his last release?
> 
> Do you mean you asked him questions he didn't respond to? 

Yes. I even got a respond from Erik in the same mail, saying that
Bernhard is the maintainer. 

> (Although Rich went with elf-based fdpic instead of a.out-based binflt,
> which means for cortex-m on musl we've got to get the
> http://www.slideshare.net/linaroorg/sfo15406-arm-fdpic-toolset-kernel-libraries-for-cortexm-cortexr-mmuless-cores
> stuff upstream.)

I am looking forward to see this and as usual I will test new ports
of musl. http://tests.embedded-test.org/musl/
 
> > - architectures not supported by any other C library like arc,
> >   xtensa, nds32, h8300, ..
> > - vintage unix hardware like SGI O2, Sparcstations, ...
> > 
> > See my table which architectures are not supported by musl/glibc:
> > http://uclibc-ng.org/wiki/matrix
> 
> Good to know.
> 
> I've had a todo item to get a coldfire target running under qemu so Rich
> can do musl support in it. It's been on my todo list for... 2 years now?
> Too much else to do...

You can just use buildroot to generate a working environment, I
contributed a defconfig for it.
 
> > But even then uClibc-ng is always a good choice for regression
> > testing and testing between the different C libraries.
> 
> Good luck with it.

Thanks.
 
> I am not interested in subscribing to your list just now, thanks.

That is fine for me. 
 Waldemar
___
uClibc mailing list
uClibc@uclibc.org
http://lists.busybox.net/mailman/listinfo/uclibc


uClibc-ng 1.0.21 released

2016-12-26 Thread Waldemar Brodkorb
Hi Embedded Hackers,

this is mostly a bugfix release.
The last problems with single libc migration where fixed.
Some stubs for libintl and a tiny libiconv implementation added.

Full changes:
Max Filippov (1):   
  
  utils: add -static to CFLAGS when HAVE_SHARED is not set  
  

  
Thomas Petazzoni (3):   
  
  libc/sysdeps/linux/common/madvise.c: disable on noMMU architectures   
  
  include/sys/mman.h: remove madvise/posix_madvise prototypes on noMMU  
  
  sys/cdefs.h: add definition of __attribute_alloc_size__   
  

  
Waldemar Brodkorb (12): 
  
  bfin: fix a gcc warning   
  
  fix static linking for FDPIC toolchains   
  
  xtensa: fix static linking
  
  threads: optimize single threaded applications
  
  add libiconv-tiny implementation  
  
  add stub implementation for libintl/gettext   
  
  remove __MALLOC_GLIBC_COMPAT__ option 
  
  remove obstack support
  
  remove misc/gnu, cleanup comment  
  
  remove UCLIBC_LINUX_MODULE_26 
  
  mips: use the common dirent.h 
  
  bump for release  

Happy hacking,
 Waldemar
___
uClibc mailing list
uClibc@uclibc.org
http://lists.busybox.net/mailman/listinfo/uclibc


new uClibc-ng release 1.0.20

2016-12-04 Thread Waldemar Brodkorb
Hi Hackers,

I released a new version of uClibc-ng today.

It contains as usual some cleanups and support for new stuff.
UCLIBC_HAS_LFS got removed. 
The new release includes experimental support for microblaze
NPTL/TLS and Nios2 MMU systems (static only, no ld.so/NPTL/TLS).
The test suite got removed and is a separate project now.
That ensures that all tests are compiled with the full gcc and not
with some intermediate compiler.

Please update and report any issues.

Detailed commit log:

http://mailman.uclibc-ng.org/pipermail/devel/2016-December/001304.html

Thanks,
 Waldemar

___
uClibc mailing list
uClibc@uclibc.org
http://lists.busybox.net/mailman/listinfo/uclibc


Re: uclibc(1.0.12) mq_send return value and errno issue

2016-11-23 Thread Waldemar Brodkorb
Hi Frank,
Frank Liu wrote,

> Please see the attached sample code. 
> 
> If I  turn READERS and WRITERS to 0, the test works fine. 
> 
> Adding another thread in the process by setting a non-zero number to either 
> READERS or WRITER, the test program crashes due to the assertion at line 99. 

I think I found the reason for the problem.

Try attached patch,

best regards
 Waldemar
>From 650e6cbd0fccf8d20efc0844582934eae8da1f58 Mon Sep 17 00:00:00 2001
From: Waldemar Brodkorb 
Date: Thu, 24 Nov 2016 04:14:20 +0100
Subject: [PATCH 1/2] arm: use common ret_ERRVAL

Signed-off-by: Waldemar Brodkorb 
---
 libc/sysdeps/linux/arm/sysdep.h | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/libc/sysdeps/linux/arm/sysdep.h b/libc/sysdeps/linux/arm/sysdep.h
index 80bf9ec..8813f8e 100644
--- a/libc/sysdeps/linux/arm/sysdep.h
+++ b/libc/sysdeps/linux/arm/sysdep.h
@@ -137,9 +137,6 @@
 #define	PSEUDO_END_ERRVAL(name) \
   END (name)
 
-#undef ret_ERRVAL
-#define ret_ERRVAL PSEUDO_RET_NOERRNO
-
 #if defined NOT_IN_libc
 # define SYSCALL_ERROR __local_syscall_error
 #  define SYSCALL_ERROR_HANDLER	\
-- 
2.1.4

___
uClibc mailing list
uClibc@uclibc.org
http://lists.busybox.net/mailman/listinfo/uclibc

Re: uclibc(1.0.12) mq_send return value and errno issue

2016-11-17 Thread Waldemar Brodkorb
Hi,
Frank Liu wrote,

> Hi All,
> 
> Kernel version : 4.4.19-linux4sam_5.4
> uclibc version : 1.0.12
> uclibc threading support : NPTL
> Processor Arch: ARM

Better you switch to uClibc-ng mailinglist for this question.
 
> We create a NONBLOCKING message queue.
> 
> The expected behavior is when the message queue is full, calling mq_send 
> would return -1 and set errno to EAGAIN(11). However we are seeing some 
> inconsistent behaviors of mq_send.
> 
> When calling mq_send in a single threaded environment, the expected behavior 
> is observed.
> 
> If the program starts a second thread, which is doing completely different 
> task, calling mq_send when the queue is full would return -11 instead of -1. 
> Also, the errno is set to an incorrect value. Values we have seen are 0, 2, 
> which are completely different from the expected EAGAIN(11).

Can you provide a simple test case to check the behaviour?

best regards
 Waldemar
___
uClibc mailing list
uClibc@uclibc.org
http://lists.busybox.net/mailman/listinfo/uclibc


Re: [uclibc-ng-devel] [PATCH 0/3] ARC atomics support updates

2016-11-16 Thread Waldemar Brodkorb
Hi Vineet,
Vineet Gupta wrote,

> Hi,
> 
> This fixes ARC port to support configs lacking llock/scond using kernel
> assisted cmpxchg.
> 
Applied and pushed,
 thx
  Waldemar
___
uClibc mailing list
uClibc@uclibc.org
http://lists.busybox.net/mailman/listinfo/uclibc


Re: [uclibc-ng-devel] [PATCH] ARC: string: handle gcc 6.x macro changes

2016-11-16 Thread Waldemar Brodkorb
Hi Vineet,
Vineet Gupta wrote,

> In gcc 6.x cleanup, the macros got renamed.
> (Need to support the old toggle for some more time)

Applied and pushed,

 thx
   Waldemar
___
uClibc mailing list
uClibc@uclibc.org
http://lists.busybox.net/mailman/listinfo/uclibc


new release 1.0.19

2016-10-23 Thread Waldemar Brodkorb
Hi Embedded-Linux-Hackers,

this release is mostly bug fixing and regression fixes from the
single-libc patch.

Next release will separate the testsuite to its own project.

Thanks for testing and bug reports,
 Waldemar

Changes:

John Ata (1):
  Fix nftw when called with FTW_CHDIR and FTW_DEPTH

Vineet Gupta (4):
  ARC: nptl: cancellable wrappers were broken
  ARC: nptl: cancellable wrappers were broken #2
  ARC: update .note.ABI-tag for ABIv4
  ARC: build: don't force usage of llock and swape instructions

Waldemar Brodkorb (14):
  locale: remove building for the host, as it breaks
  ubacktrace/uargp: remove unneeded and false linker scripts
  remove linux kernel 2.4 modules support
  cleanup ppc port
  test: fix tests including non-wrapper libgcc exception handling code
  cleanup libc.a
  ppc: do not include copysgnl.c if UCLIBC_HAS_LONG_DOUBLE_MATH enabled
  fix mips/mips64 build for old compilers
  cleanup and fix static linking issues
  linuxthreads: allow to choose on all supported architectures
  create empty static files conditionally
  test: add nftw test case
  test: add a simple check, that -std=c99 working
  bump for release

___
uClibc mailing list
uClibc@uclibc.org
http://lists.busybox.net/mailman/listinfo/uclibc


Re: [uclibc-ng-devel] [PATCH] ARC: update .note.ABI-tag for ABIv4

2016-10-22 Thread Waldemar Brodkorb
Hi,

Thanks, applied and pushed,

best regards
 Waldemar

Vineet Gupta wrote,

> Cc: Anton Kolesov 
> Cc: linux-snps-...@lists.infradead.org
> Signed-off-by: Vineet Gupta 
> ---
>  libc/sysdeps/linux/arc/crt1.S | 6 +-
>  1 file changed, 5 insertions(+), 1 deletion(-)
> 
> diff --git a/libc/sysdeps/linux/arc/crt1.S b/libc/sysdeps/linux/arc/crt1.S
> index ae863e7acf5f..70a06e058d3b 100644
> --- a/libc/sysdeps/linux/arc/crt1.S
> +++ b/libc/sysdeps/linux/arc/crt1.S
> @@ -72,5 +72,9 @@ __start:
>  0:   .asciz "GNU"/* Vendor name */
>  1:   .align 4
>  2:   .long 0 /* Note data: Linux executable */
> - .long 3,9,0 /* Earliest compatible kernel */
> +#if (__GNUC__ > 4)
> + .long 4,8,0 /* Earliest compatible kernel for ABI v4 */
> +#else
> + .long 3,9,0 /* Earliest compatible kernel for ABI v3 */
> +#endif
>  3:   .align 4/* Pad out section */
> -- 
> 2.7.4
> 
> ___
> devel mailing list
> de...@uclibc-ng.org
> http://mailman.uclibc-ng.org/cgi-bin/mailman/listinfo/devel
___
uClibc mailing list
uClibc@uclibc.org
http://lists.busybox.net/mailman/listinfo/uclibc


new release 1.0.18 - Delirium Nocturnum

2016-09-27 Thread Waldemar Brodkorb
Hi Embedded Hackers,

I cut a new release today. I think most important
change is the commit:
use a single libc and deduplicate threading code

Please report any breakage or regressions.

Have fun!

Thanks
 Waldemar

Here are the complete changes:

Eric Le Bihan (1):
  librt: fix path parsing in __spawni()

Eugeniy Paltsev (1):
  ARC: Fix max ULP for cosine test

Leonid Lisovskiy (1):
  linuxthreads: Fix up pthread.h for XPG7.

Rahul Bedarkar (1):
  elf-{fdpic, dsbt}.h: avoid void pointer's subtraction

Vineet Gupta (1):
  ARC: Support syscall ABI v4

Waldemar Brodkorb (21):
  sunrpc: Do not use alloca in clntudp_call
  arm: fix compile in thumb mode
  linuxthreads: install libpthread_nonshared.a
  delete dead code, use -Wdeclaration-after-statement by default
  mips: add NaN support
  remove DOMULTI support
  test: disable regex tests
  microblaze: fixup headers to make gdb compile happy
  sync header with glibc
  remove dead code and documentation
  always assume tgkill is present
  linuxthreads: use tkill syscall for raise
  test: sync tst-atfork2 with GNU libc
  use a single libc and deduplicate threading code
  locale: cleanup support
  microblaze: add ulps file
  test: fix parallel build issue
  ldd: fix compile for some architectures
  test: remove ULPs for unsupported architecture
  locale: disable parallel build as it is broken here
  bump for release






signature.asc
Description: Digital signature
___
uClibc mailing list
uClibc@uclibc.org
http://lists.busybox.net/mailman/listinfo/uclibc

Re: [uclibc-ng-devel] [uClibc] ARC: Support syscall ABI v4

2016-08-17 Thread Waldemar Brodkorb
Hi Vineet,
Vineet Gupta wrote,

> The syscall ABI includes the gcc functional calling ABI since a syscall
> implies userland caller and kernel callee.
> 
> The current gcc ABI (v3) for ARCv2 ISA required 64-bit data be passed in
> even-odd register pairs, (potentially punching reg holes when passing such
> values as args). This was partly driven by the fact that the double-word
> LDD/STD instructions in ARCv2 expect the register alignment and thus gcc
> forcing this avoids extra MOV at the cost of a few unused register (which we
> have plenty anyways).
> 
> This however was rejected as part of upstreaming gcc port to HS. So the new
> ABI v4 doesn't enforce the even-odd reg restriction.
> 
> Do note that for ARCompact ISA builds v3 and v4 are practically the same in
> terms of gcc code generation.
> 
> This change is dormant for now (gcc 4.8.x based tools) and will only kick
> in with switch to gcc 6.x based tools.
> 
> Signed-off-by: Vineet Gupta 

Thanks, applied and pushed,
 Waldemar
___
uClibc mailing list
uClibc@uclibc.org
http://lists.busybox.net/mailman/listinfo/uclibc


Re: CVE-2016-4429 vulnerability

2016-08-10 Thread Waldemar Brodkorb
Hi,
siva gopi raju kudeti wrote,

> Hi Waldemar,
> 
> Thanks for the immediate replay.
> 
> The patch you given looks good. I will make out this patch.
> 
> After that, testing with the IPERF or PING is fine or any other way is
> there to test.
> 
> Can you please suggest me to do that.

Not sure how to test it. May be there is some information about it
in the CVE. As it is in the RPC code, I suggest using some RPC
services like NFSv3.

https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2016-4429

I am not sure if any exploit exist, which you could use that
the buffer overflow is fixed.

best regards
 Waldemar
___
uClibc mailing list
uClibc@uclibc.org
http://lists.busybox.net/mailman/listinfo/uclibc


Re: CVE-2016-4429 vulnerability

2016-08-05 Thread Waldemar Brodkorb
Hi Gopi,
siva gopi raju kudeti wrote,

> Hi uClibc team,
> 
> I am using uClibc-0.9.33.2.tar.bz2 in my product. Here i want to know that
> uClibc is CVE-2016-4429 vulnerable or not.
> 
> CVE-2016-4429 is stack overflow vulnerability. So, I have seen some code
> snippet which affects the stack overflow in the
> function clntudp_call in the file clnt_udp.c. But i don't know how to test
> it, for actually affecting the stack.
> 
> Can you please provide me with the test process or give me the results if
> it is vulnerable to the CVE-2016-4429 if you have done testing already.
> 
> I will wait for your reply.

I do not think the uClibc project is active anymore.
I have added the GNU libc patch to uClibc-ng:
http://cgit.uclibc-ng.org/cgi/cgit/uclibc-ng.git/commit/?id=9213ad631513d0e67d9d31465c9cdb3f3dde0399

It will be in the next release. You should better switch to
uClibc-ng with your product.

best regards
 Waldemar
___
uClibc mailing list
uClibc@uclibc.org
http://lists.busybox.net/mailman/listinfo/uclibc


new release 1.0.17

2016-08-01 Thread Waldemar Brodkorb
Hi,

I cut a new release mainly for inclusion in Buildroot rc1.
It includes a lot of cleanup patches and some ARC improvements
including PIE support.

Have fun
 Waldemar



signature.asc
Description: Digital signature
___
uClibc mailing list
uClibc@uclibc.org
http://lists.busybox.net/mailman/listinfo/uclibc

Re: [uclibc-ng-devel] [PATCH] ARC: Support R_ARC_JMP_SLOT relocations during bootstrap

2016-07-31 Thread Waldemar Brodkorb
Hi Andrew,
Andrew Burgess wrote,

> I ran into this issue while trying to debug a _different_ issue witin
> the uClinc(-ng) arc dynamic linker.  I turned on debugging support
> within the dynamic linker, and the linker would no longer complete its
> bootstrap phase due to a lack of support for the R_ARC_JMP_SLOT
> relocation type.
> 
> To reproduce this issue it should be enough to configure uClibc(-ng)
> for ARC with 'DODEBUG=y', then try to run anything that requires
> dynamic linking.
> 
> The R_ARC_JMP_SLOT relocation type is used within the .plt, so I
> believe it makes sense for these relocations to be generated.
> 
> I updated the associated comment above the boostrap patching code so
> that it makes more sense (to me at least) with the extra relocation
> support.
> 
> I wonder if you would consider merging this patch?

Yes, I merged it and pushed,
 Thanks
  Waldemar
___
uClibc mailing list
uClibc@uclibc.org
http://lists.busybox.net/mailman/listinfo/uclibc


Re: [PATCH 2/2] ARC: Add new compiler define to indicate @pcl relocation support

2016-07-28 Thread Waldemar Brodkorb
Hi Andrew,
Andrew Burgess wrote,

> Some old versions of binutils did not support @pcl relocations.  This
> commit adds a new flag to the uClibc configuration system that detects
> if the toolchain supports @pcl relocations or not.
> 
> If this relocation is supported then the define ARC_HAS_AT_PCL_RELOC
> will be passed to the compiler, which is then used in the arc ldso to
> choose between generating old or new style code.
> 
> This commit addresses and issue that was worked around in commit
> 181d410ad00cddd1d6c9f4835e129136b74c5187 (ARC: Conditionalise certain
> relocations as provided by TLS tools only).  In this commit the choice
> between old or new style relocations was made based on whether uClibc
> was configured with native threads or not.  The problem is that a user
> of a new toolchain might choose to configure without native threads.
> ---
>  Rules.mak  | 2 ++
>  ldso/ldso/arc/dl-startup.h | 2 +-
>  ldso/ldso/arc/dl-sysdep.h  | 4 
>  3 files changed, 7 insertions(+), 1 deletion(-)
> 
> diff --git a/Rules.mak b/Rules.mak
> index 3c80016..04ff02f 100644
> --- a/Rules.mak
> +++ b/Rules.mak
> @@ -507,9 +507,11 @@ ifeq ($(TARGET_ARCH),c6x)
>  endif
>  
>  ifeq ($(TARGET_ARCH),arc)
> + ARC_HAS_AT_PCL_RELOC:=$(shell echo -e "\t.text\n\tadd 
> r0,pcl,_symbol@pcl" | $(CC) -c -x assembler -o /dev/null -  2> /dev/null && 
> echo -n y || echo -n n)
>   CPU_CFLAGS-y += -mlock -mswape
>   CPU_CFLAGS-$(CONFIG_ARC_CPU_700) += -mA7
>   CPU_CFLAGS-$(CONFIG_ARC_CPU_HS) += -mcpu=archs
> + CPU_CFLAGS-$(ARC_HAS_AT_PCL_RELOC) += -DARC_HAS_AT_PCL_RELOC
>   CPU_LDFLAGS-y += $(CPU_CFLAGS) -marclinux
>  endif

I tried the patch, but get this with arc 2016.03 (ARC700, LE):

/home/wbx/embedded-test/openadk/toolchain_nsim-arcv1_uclibc-ng_arc700/usr/bin/arc-openadk-linux-uclibc-gcc
-c libc/sysdeps/linux/common/pause.c -o
libc/sysdeps/linux/common/pause.os -Wall -Wstrict-prototypes
-Wstrict-aliasing -funsigned-char -fno-builtin -fno-asm
-fmerge-all-constants -std=gnu99 -mlock -mswape -mA7
-fno-stack-protector -nostdinc -I./include -I./include -include
libc-symbols.h -I./libc/sysdeps/linux/arc -I./libc/sysdeps/linux
-I./ldso/ldso/arc -I./ldso/include -I. -Os -fstrict-aliasing -fwrapv
-fno-ident -mcpu=arc700 -Os -pipe -fomit-frame-pointer
-fno-unwind-tables -fno-asynchronous-unwind-tables
-D__USE_STDIO_FUTEXES__ -DHAVE_FORCED_UNWIND -D_LIBC_REENTRANT
-I./libpthread/nptl -I./libpthread/nptl
-I./libpthread/nptl/sysdeps/unix/sysv/linux/arc
-I./libpthread/nptl/sysdeps/arc -I./libpthread/nptl/sysdeps/arc
-I./libpthread/nptl/sysdeps/unix/sysv/linux
-I./libpthread/nptl/sysdeps/unix/sysv/linux
-I./libpthread/nptl/sysdeps/pthread
-I./libpthread/nptl/sysdeps/pthread/bits
-I./libpthread/nptl/sysdeps/generic -I./libc/sysdeps/linux/common
-isystem
/home/wbx/embedded-test/openadk/toolchain_nsim-arcv1_uclibc-ng_arc700/usr/lib/gcc/arc-openadk-linux-uclibc/4.8.5/include-fixed
-isystem
/home/wbx/embedded-test/openadk/toolchain_nsim-arcv1_uclibc-ng_arc700/usr/lib/gcc/arc-openadk-linux-uclibc/4.8.5/include
-I/home/wbx/embedded-test/openadk/target_nsim-arcv1_uclibc-ng_arc700/usr/include/
-DNDEBUG -DIN_LIB=libc -fPIC -fexceptions
-fasynchronous-unwind-tables -MT libc/sysdeps/linux/common/pause.os
-MD -MP -MF libc/sysdeps/linux/common/.pause.os.dep
{standard input}: Assembler messages:
{standard input}:15: Error: invalid operands (.bss and .text
sections) for `-'
{standard input}:15: Error: invalid operands (.text and *ABS*
sections) for `&'
{standard input}:17: Error: invalid operands (.text.exit and .text
sections) for `-'
{standard input}:17: Error: invalid operands (.text and *ABS*
sections) for `&'
Makerules:385: recipe for target 'ldso/ldso/ldso.oS' failed
make[6]: *** [ldso/ldso/ldso.oS] Error 1

It seems ARC_HAS_AT_PCL_RELOC isn't set. I tracked it down, it seems
a combination of my shell and echo -e usage. I know there is another
echo -e usage in Rules.mak and I will fix it later. Can you please
resend the patch with printf instead of echo -e, if the Synopsis ARC
developers agree on this patch?
I added the trailing "\n" to avoid a unnecessary warning when trying
just the command in a shell, sth like that:

diff --git a/Rules.mak b/Rules.mak
index 04ff02f..8b962b4 100644
--- a/Rules.mak
+++ b/Rules.mak
@@ -507,7 +507,7 @@ ifeq ($(TARGET_ARCH),c6x)
 endif
 
 ifeq ($(TARGET_ARCH),arc)
-   ARC_HAS_AT_PCL_RELOC:=$(shell echo -e "\t.text\n\tadd
r0,pcl,_symbol@pcl" | $(CC) -c -x assembler -o /dev/null -
2> /dev/null && echo -n y || echo -n n)
+   ARC_HAS_AT_PCL_RELOC:=$(shell printf "\t.text\n\tadd
r0,pcl,_symbol@pcl\n" | $(CC) -c -x assembler -o /dev/null - 2>
/dev/null && echo -n y || echo -n n)
CPU_CFLAGS-y += -mlock -mswape
CPU_CFLAGS-$(CONFIG_ARC_CPU_700) += -mA7
CPU_CFLAGS-$(CONFIG_ARC_CPU_HS) += -mcpu=archs

Otherwise looks good to me and fixes my problem with a nothread
build :)

thanks
 Waldemar
___
uClibc maili

new release 1.0.16

2016-07-02 Thread Waldemar Brodkorb
Hi,

I cut a new release today. Highlights are a lot of new contributors
provided a lot of bugfixes. I added support for a new architecture
called NDS32 from Andes Technology.

Test results will follow in a few days here:
http://tests.embedded-test.org/uClibc-ng/

Full changelog:
Alexey Brodkin (2):
  ARC: remove deprecated -msoft-float from CFLAGS
  libs: install backward compatibility symlinks

Anton Kolesov (1):
  ARC: Implement .note.ABI-tag section in crt1.S

Eugeniy Paltsev (2):
  Fix hardcoded mmap offset
  test: inet: Fix warning messages


 
Ingo van Lil (1):
  inet/resolv: Try search domains first for unqualified names

Jan Vangorp (2):
  Fix infinite loop when fopencookie custom write returns 0 on error
  Fix return value of fwrite when a 'hard' error occurs

Leonid Lisovskiy (6):
  tests: Take in account Makefiles that have meaning for rebuild only.
  linuxthreads.old: Fix segfault when pthread_mutex_unlock()
called against unlocked NORMAL mutex.   
  ARM: nptl: Use generic lowlevellock.c, patch from glibc
  ldso: Consistently set & use DL_OPENED flag in both ld.so and libdl
  ldso: fix dlsym hang when reloading DSOs
  bits/sigset.h: Fix _EXTERN_INLINE redefinition


 
Lucian Cojocar (1):
  bugfix: ARM: memset.S: use unsigned comparisons


 
Max Filippov (1):
  tests: add %ms scanf format test

Nicolas Cavallari (1):
  sysconf: Support _SC_(AV)?PHYS_PAGES.

Vineet Gupta (1):
  ARC: Enable shared crt1

Vlad Zakharov (1):
  test: regex: Make testregex return error count

Waldemar Brodkorb (19):
  arm: add non-assembly versions of pthread_spin_lock/pthread_spin_trylock
  remove MJN only debug messages
  ppc: cleanup unsupported ppc64 code
  test: sync with GNU libc
  test: quieten some gcc warnings
  microblaze: remove unused dead code
  ssp: remove SSP legacy code
  test: add new mmap tests from glibc
  arc: use generic lowlevellock
  metag: use generic lowlevellock
  xtensa: use generic lowlevellock
  add MAINTAINERS information
  test: mmap2 is not ARM specific
  remove unused Makefiles
  or1k: add dummy sys/user.h for strace
  argp: select getopt / getopt_long
  nds32: add support for new architecture
  Add nds32 maintainers
  bump for release


 
Wenzel, Alexander (1):
  inet/getaddrinfo: fix AF_V4MAPPED behavior for non IPv6 host resolution

Have fun,
 Waldemar

___
uClibc mailing list
uClibc@uclibc.org
http://lists.busybox.net/mailman/listinfo/uclibc


Re: [uclibc-ng-devel] [PATCH] ARC: support shared crt1

2016-06-21 Thread Waldemar Brodkorb
Hi Vineet,
Vineet Gupta wrote,

ping?
(resend with better changelog)

> On Wednesday 15 June 2016 08:34 PM, Waldemar Brodkorb wrote:
> > Hi Vineet,
> > Vineet Gupta wrote,
> >
> >> Signed-off-by: Vineet Gupta 
> >> ---
> >>  libc/sysdeps/linux/arc/crt1.S | 8 ++--
> >>  1 file changed, 6 insertions(+), 2 deletions(-)
> >>
> >> diff --git a/libc/sysdeps/linux/arc/crt1.S b/libc/sysdeps/linux/arc/crt1.S
> >> index 95c41f50..e38c8e81b2c0 100644
> >> --- a/libc/sysdeps/linux/arc/crt1.S
> >> +++ b/libc/sysdeps/linux/arc/crt1.S
> >> @@ -41,11 +41,15 @@ __start:
> >>  
> >>mov_s   r5, r0  ; rltd_fini
> >>add_s   r2, sp, 4   ; argv
> >> -
> >> +#ifdef L_Scrt1
> >> +  add r0, pcl, @main@pcl
> >> +  add r3, pcl, @_init@pcl
> >> +  add r4, pcl, @_fini@pcl
> >> +#else
> >>mov_s   r0, main
> >>mov_s   r3, _init
> >>mov r4, _fini
> >> -
> >> +#endif
> >>and sp, sp, -8
> >>mov r6, sp
> > Can you please be a little more descriptive why this patch is
> > useful? Will ARC support static PIE or is Scrt1.o used in other
> > code?
> 
> This is for a dynamically linked PIE - can we have static linked PIE ? Current
> approach of taking addresses of functions, in not position independent but 
> still
> works for the normal dynamically linked executables (non PIE) since the zero 
> based
> addresses are rightly resolved in final link. This is not true for PIE hence 
> we
> need a really position independent way (PC relative addr) to pass those 
> function
> addresses.
> 
> Do u want me to respin with beefed up changelog.
> 
> > Sorry, had to resend with correct sender address.
> 
> My address was wrong ?
> 
> 
> ___
> uClibc mailing list
> uClibc@uclibc.org
> http://lists.busybox.net/mailman/listinfo/uclibc
> 
___
uClibc mailing list
uClibc@uclibc.org
http://lists.busybox.net/mailman/listinfo/uclibc


Re: [uclibc-ng-devel] [PATCH] ARC: support shared crt1

2016-06-16 Thread Waldemar Brodkorb
Hi Vineet,
Vineet Gupta wrote,

> On Wednesday 15 June 2016 08:34 PM, Waldemar Brodkorb wrote:
> > Hi Vineet,
> > Vineet Gupta wrote,
> >
> >> Signed-off-by: Vineet Gupta 
> >> ---
> >>  libc/sysdeps/linux/arc/crt1.S | 8 ++--
> >>  1 file changed, 6 insertions(+), 2 deletions(-)
> >>
> >> diff --git a/libc/sysdeps/linux/arc/crt1.S b/libc/sysdeps/linux/arc/crt1.S
> >> index 95c41f50..e38c8e81b2c0 100644
> >> --- a/libc/sysdeps/linux/arc/crt1.S
> >> +++ b/libc/sysdeps/linux/arc/crt1.S
> >> @@ -41,11 +41,15 @@ __start:
> >>  
> >>mov_s   r5, r0  ; rltd_fini
> >>add_s   r2, sp, 4   ; argv
> >> -
> >> +#ifdef L_Scrt1
> >> +  add r0, pcl, @main@pcl
> >> +  add r3, pcl, @_init@pcl
> >> +  add r4, pcl, @_fini@pcl
> >> +#else
> >>mov_s   r0, main
> >>mov_s   r3, _init
> >>mov r4, _fini
> >> -
> >> +#endif
> >>and sp, sp, -8
> >>mov r6, sp
> > Can you please be a little more descriptive why this patch is
> > useful? Will ARC support static PIE or is Scrt1.o used in other
> > code?
> 
> This is for a dynamically linked PIE - can we have static linked PIE ? Current
> approach of taking addresses of functions, in not position independent but 
> still
> works for the normal dynamically linked executables (non PIE) since the zero 
> based
> addresses are rightly resolved in final link. This is not true for PIE hence 
> we
> need a really position independent way (PC relative addr) to pass those 
> function
> addresses.

You can try static PIE with binutils 2.26 and up with
-Wl,--no-dynamic-linker, but my tests with ARM/MIPS failed.
So I am not sure if crt1.S is the problem or something else.
 
> Do u want me to respin with beefed up changelog.

Yes, please.
 
> > Sorry, had to resend with correct sender address.
> 
> My address was wrong ?

No, I use mutt and I am to lazy to configure send-hooks, so I
manually change my mail address before sending e-Mails :/

best regards
 Waldemar
___
uClibc mailing list
uClibc@uclibc.org
http://lists.busybox.net/mailman/listinfo/uclibc


Re: [uclibc-ng-devel] [PATCH] ARC: support shared crt1

2016-06-15 Thread Waldemar Brodkorb
Hi Vineet,
Vineet Gupta wrote,

> Signed-off-by: Vineet Gupta 
> ---
>  libc/sysdeps/linux/arc/crt1.S | 8 ++--
>  1 file changed, 6 insertions(+), 2 deletions(-)
> 
> diff --git a/libc/sysdeps/linux/arc/crt1.S b/libc/sysdeps/linux/arc/crt1.S
> index 95c41f50..e38c8e81b2c0 100644
> --- a/libc/sysdeps/linux/arc/crt1.S
> +++ b/libc/sysdeps/linux/arc/crt1.S
> @@ -41,11 +41,15 @@ __start:
>  
>   mov_s   r5, r0  ; rltd_fini
>   add_s   r2, sp, 4   ; argv
> -
> +#ifdef L_Scrt1
> + add r0, pcl, @main@pcl
> + add r3, pcl, @_init@pcl
> + add r4, pcl, @_fini@pcl
> +#else
>   mov_s   r0, main
>   mov_s   r3, _init
>   mov r4, _fini
> -
> +#endif
>   and sp, sp, -8
>   mov r6, sp

Can you please be a little more descriptive why this patch is
useful? Will ARC support static PIE or is Scrt1.o used in other
code?

best regards
 Waldemar

Sorry, had to resend with correct sender address.
___
uClibc mailing list
uClibc@uclibc.org
http://lists.busybox.net/mailman/listinfo/uclibc


Re: [uclibc-ng-devel] [PATCH] ldso/ARC: fix DT_RELACOUNT handling

2016-06-01 Thread Waldemar Brodkorb
Hi Alexey,
Alexey Brodkin wrote,
> Hi Waldemar,
> 
> On Tue, 2016-05-31 at 06:15 +0200, Waldemar Brodkorb wrote:
> > Hi,
> > Waldemar Brodkorb wrote,
> > 
> > > 
> > > Hi,
> > > Waldemar Brodkorb wrote,
> > > 
> > > > 
> > > > Hi Vineet,
> > > > Vineet Gupta wrote,
> > > > 
> > > > > 
> > > > > On Sunday 29 May 2016 01:30 AM, Waldemar Brodkorb wrote:
> > > > > > 
> > > > > > ARC has between 28-30 failures even with latest binutils/gcc
> > > > > Latest here is pretty overloaded :-) We had 2016.03 release recently 
> > > > > and then
> > > > > there's bleeding edge binutils atleast which is tracking pretty close 
> > > > > to upstream
> > > > > binutils.
> > > > > 
> > > > > What exact versions of these tools are you using.
> > > > I am using 2016.03. I wanted to say latest release :=)
> > > > 
> > > > The 1.0.15 testrun is not yet finished, but I think it is
> > > > simply reproducable by running nsim and uclibcng-testrunner.sh.
> > > Nsim is nice to script, but the performance
> > > is pretty bad. Running the testsuite takes for the four combinations
> > > (arc700,archs,little and big mode) mostly the same time as 
> > > running all the other tests in Qemu :)
> > > 1 CORE 100 % CPU...
> > > 
> > > Would be NSIM Pro faster?
> > Here are the 1.0.15 results:
> > http://tests.embedded-test.org/uClibc-ng/1.0.15/
> 
> Thank you so much for doing that, appreciate it a lot!
> 
> I'm wondering if there's a reason why did you use Linux 4.4
> instead of latest (4.6)? Since we push all out stuff upstream
> chances are some failures won't happen with more recent kernel.

Normally I try to run with latest LTS kernel for the testing.
I updated ARC tests to use 4.6. (one failure disappeared)
 
> Also from the logs it's not clear what tools were used?
> Was it latest stable arc-2016.03, previous arc-2015.12?
> I'd like to have this information to narrow down investigation of
> failure reasons.

arc-2016.03 is used here. I will add some information about
OpenADK git version used and GCC/Binutils used for running the stuff
in the future.

best regards
 Waldemar
___
uClibc mailing list
uClibc@uclibc.org
http://lists.busybox.net/mailman/listinfo/uclibc

Re: [uclibc-ng-devel] [PATCH] ldso/ARC: fix DT_RELACOUNT handling

2016-05-30 Thread Waldemar Brodkorb
Hi,
Waldemar Brodkorb wrote,

> Hi,
> Waldemar Brodkorb wrote,
> 
> > Hi Vineet,
> > Vineet Gupta wrote,
> > 
> > > On Sunday 29 May 2016 01:30 AM, Waldemar Brodkorb wrote:
> > > > ARC has between 28-30 failures even with latest binutils/gcc
> > > 
> > > Latest here is pretty overloaded :-) We had 2016.03 release recently and 
> > > then
> > > there's bleeding edge binutils atleast which is tracking pretty close to 
> > > upstream
> > > binutils.
> > > 
> > > What exact versions of these tools are you using.
> > 
> > I am using 2016.03. I wanted to say latest release :=)
> > 
> > The 1.0.15 testrun is not yet finished, but I think it is
> > simply reproducable by running nsim and uclibcng-testrunner.sh.
> 
> Nsim is nice to script, but the performance
> is pretty bad. Running the testsuite takes for the four combinations
> (arc700,archs,little and big mode) mostly the same time as 
> running all the other tests in Qemu :)
> 1 CORE 100 % CPU...
> 
> Would be NSIM Pro faster?

Here are the 1.0.15 results:
http://tests.embedded-test.org/uClibc-ng/1.0.15/

best regards
 Waldemar
___
uClibc mailing list
uClibc@uclibc.org
http://lists.busybox.net/mailman/listinfo/uclibc


Re: [uclibc-ng-devel] [PATCH] ldso/ARC: fix DT_RELACOUNT handling

2016-05-29 Thread Waldemar Brodkorb
Hi,
Waldemar Brodkorb wrote,

> Hi Vineet,
> Vineet Gupta wrote,
> 
> > On Sunday 29 May 2016 01:30 AM, Waldemar Brodkorb wrote:
> > > ARC has between 28-30 failures even with latest binutils/gcc
> > 
> > Latest here is pretty overloaded :-) We had 2016.03 release recently and 
> > then
> > there's bleeding edge binutils atleast which is tracking pretty close to 
> > upstream
> > binutils.
> > 
> > What exact versions of these tools are you using.
> 
> I am using 2016.03. I wanted to say latest release :=)
> 
> The 1.0.15 testrun is not yet finished, but I think it is
> simply reproducable by running nsim and uclibcng-testrunner.sh.

Nsim is nice to script, but the performance
is pretty bad. Running the testsuite takes for the four combinations
(arc700,archs,little and big mode) mostly the same time as 
running all the other tests in Qemu :)
1 CORE 100 % CPU...

Would be NSIM Pro faster?

best regards
 Waldemar
___
uClibc mailing list
uClibc@uclibc.org
http://lists.busybox.net/mailman/listinfo/uclibc


Re: [uclibc-ng-devel] [PATCH] ldso/ARC: fix DT_RELACOUNT handling

2016-05-29 Thread Waldemar Brodkorb
Hi Vineet,
Vineet Gupta wrote,

> On Sunday 29 May 2016 01:30 AM, Waldemar Brodkorb wrote:
> > ARC has between 28-30 failures even with latest binutils/gcc
> 
> Latest here is pretty overloaded :-) We had 2016.03 release recently and then
> there's bleeding edge binutils atleast which is tracking pretty close to 
> upstream
> binutils.
> 
> What exact versions of these tools are you using.

I am using 2016.03. I wanted to say latest release :=)

The 1.0.15 testrun is not yet finished, but I think it is
simply reproducable by running nsim and uclibcng-testrunner.sh.

best regards
 Waldemar
___
uClibc mailing list
uClibc@uclibc.org
http://lists.busybox.net/mailman/listinfo/uclibc


new release 1.0.15

2016-05-29 Thread Waldemar Brodkorb
Hi Embedded Hackers,

I cut a new release. 

Most important changes are the removal of LT.new. LT.old symbols
got renamed. Please update your uClibc-ng configs.
The microblaze support got some needed fixups and seems to be
usable now. (LDSO support fixed, Linuxthreads support fixed).
You need a GCC patch to make use of it.
http://cgit.openadk.org/cgi/cgit/openadk.git/tree/toolchain/gcc/patches/5.3.0/microblaze-uclibc.patch
Context functionality for sparc added in this release.

Alexey Brodkin (1): 
   
  ldso: Force disable -mlong-calls when compiling ldso for ARC  
   

   
Baruch Siach (1):   
   
  sigaction: fix for THREADS_NATIVE 
   

   
Cupertino Miranda (1):  
   
  ldso/ARC: fix DT_RELACOUNT handling   
   

   
Leonid Lisovskiy (2):   
   
  linuxthreads: Fix warnings in pthread_tryjoin_np(),
pthread_timedjoin_np()  
 
  buildsys: Fix broken link.asneeded function   
   

   
Waldemar Brodkorb (14): 
   
  dltest: fix a typo
   
  sparc: add deprecated context switching functions 
   
  test: add memmove test
   
  fixup stupid mixup of Makefile copyright and C code   
   
  nptl/tls tests need shared library support
   
  libpthread: add missing file for gdbserver
   
  remove linuxthreads.new, rename linuxthreads.old  
   
  microblaze: fix ELF detection in ld.so
   
  microblaze: fix setjmp/longjmp
   
  microblaze: fix linuxthreads support  
   
  sparc: remove unused 64 bit support code  
   
  Revert "disable always failing tst-signal7"   
   
  mips: allow to disable prefetch support in memcpy/memset  
   
  bump for release

Have fun,
 Waldemar

___
uClibc mailing list
uClibc@uclibc.org
http://lists.busybox.net/mailman/listinfo/uclibc


Re: [uclibc-ng-devel] [PATCH] ldso/ARC: fix DT_RELACOUNT handling

2016-05-28 Thread Waldemar Brodkorb
Hi,
Vineet Gupta wrote,

> From: Cupertino Miranda 
> 
> Wih new bintuils supporting DT_RELACOUNT, ldso was crashing as it was
> parsing relocs incorrectly.
> 
> Apparently that code ran for first time and was never tested.
> 
> Signed-off-by: Vineet Gupta 

Applied and pushed,

But the testsuite results are still not pretty.
ARM and Xtensa are down to zero failures.
ARC has between 28-30 failures even with latest binutils/gcc
release. Anyone from you can take a look?

For example:
http://tests.embedded-test.org/uClibc-ng/1.0.14/REPORT.arcv2.nsim.libc.uClibc-ng-1.0.14

 Thanks
  Waldemar
___
uClibc mailing list
uClibc@uclibc.org
http://lists.busybox.net/mailman/listinfo/uclibc


Re: [PATCH] ldso: Force disable -mlong-calls when compiling ldso for ARC

2016-05-28 Thread Waldemar Brodkorb
Hi Alexey,
Alexey Brodkin wrote,

> Even though by default for ARC uClibc gets compiled with
> disabled long-calls user may provide UCLIBC_EXTRA_CFLAGS
> with "-mlong-calls". With this option uClibc will be
> successfully compiled but later it will fail in runtime
> because dynamic loader cannot deal with relocations
> at least very early on its start.
> 
> In particular it will be seen as call to non-relocated
> symbol _dl_parse_dynamic_info() which ends-up as a segfault
> like this:
> >8
> potentially unexpected fatal signal 11.
> Path: /bin/test
> CPU: 0 PID: 63 Comm: test Not tainted 4.5.2 #7
> task: 9f13f180 ti: 9f166000 task.ti: 9f166000
> 
> [ECR   ]: 0x0004 => Insn could not be fetched
> [EFA   ]: 0x283c
> [BLINK ]: 0x2000407c
> [ERET  ]: 0x283c
> @No matching VMA found
> [STAT32]: 0x8008009e : IE U
> BTA: 0x283c  SP: 0x5fef5ccc  FP: 0x
> LPS: 0x20004080 LPE: 0x20004064 LPC: 0x
> r00: 0x20006684 r01: 0x5fef5db0 r02: 0x
> r03: 0x2000 r04: 0x80808080 r05: 0x2f2f2f2f
> r06: 0x41464d00 r07: 0x0080 r08: 0x00dd
> r09: 0x r10: 0x0073 r11: 0x80808080
> r12: 0x2000407c r13: 0x2000 r14: 0x5fef5e74
> r15: 0x000ceb3c r16: 0x5fef5e7c r17: 0x5fef5d44
> r18: 0x000ceb0c r19: 0x r20: 0x000ceb1c
> r21: 0x r22: 0x r23: 0x000d08a5
> r24: 0x r25: 0x80808080
> 
> Segmentation fault
> >8
> 
> Solution to this issue is simple we make sure dynamic
> loader never gets compiled with "-mlong-calls" by forcing
> "-mno-long-calls" on it.
> 
> Signed-off-by: Alexey Brodkin 
> Cc: Vineet Gupta 
> Cc: Anton Kolesov 
> Cc: linux-snps-...@lists.infradead.org

applied and pushed,
 Thanks
  Waldemar
___
uClibc mailing list
uClibc@uclibc.org
http://lists.busybox.net/mailman/listinfo/uclibc


new release 1.0.14

2016-04-18 Thread Waldemar Brodkorb
Hi embedded hackers,

the new release is uploaded, see here the changes made:

Alexey Neyman (1):  

  
  Provide an alias to _obstack_free 

  


  
Anthony G. Basile (1):  

  
  bits/byteswap-common.h: import recent headers from glibc  

  


  
Max Filippov (1):   

  
  xtensa: fix __sigsetjmp call12 case   

  


  
Nikola Forró (1):   

  
  replace FSF addresses with URLs   

  


  
Thomas Petazzoni (1):   

  
  arm: simplify handling of Thumb related options   

  


  
Waldemar Brodkorb (10): 

  
  frv: enable in config 

  
  nptl: remove useless text files   

  
  remove accidentally added files while cleaning up incomplete sparcv9 
support 
   
  add copyright find script 

  
  unlimited access to macros

  
  mips: refresh ULPS file for math tests

  
  simplify getpagesize, do not depend on kernel macros  

  
  remove m68k binutils workarounds  

  
  remove unused defines for lm32/or1k   

  
  bump version for release 

Please report back any issues,
 best regards
  Waldemar
___
uClibc

Re: [uclibc-ng-devel] [PATCH] bits/byteswap-common.h: import recent headers from glibc

2016-04-01 Thread Waldemar Brodkorb
Hi Anthony,
Anthony G. Basile wrote,

> From: "Anthony G. Basile" 
> 
> On systems where uClibc doesn't provide an arch specific byteswap.h,
> we fall back on bits/byteswap-common.h.  However, there is a bug
> in this header in the __bswap_constant_64(x) macro.  If, for example,
> a double is passed, we get 'invalid operands to binary &' in which we
> mismatch a 'double' and 'long long unsigned int'.  The newer glibc
> headers fix this and so we import them.  Also, since the inclusion of
> byteswap.h is not appropriate for assembly code, we guard a portion
> of endian.h which uses byteswap.h from inclusion in any assembly.
> 
> This is needed, for example, for f2fs-tools 1.6.0 on 32-bit big
> endian PowerPC.

Applied and pushed,
Thanks 
 Waldemar
___
uClibc mailing list
uClibc@uclibc.org
http://lists.busybox.net/mailman/listinfo/uclibc


Re: [uclibc-ng-devel] [PATCH] arm: simplify handling of Thumb related options

2016-03-31 Thread Waldemar Brodkorb
Hi Thomas,
Thomas Petazzoni wrote,

> Currently, the Thumb support on ARM has three related Config.in
> options, which are not trivial for users to understand, and are in
> fact not needed:
> 
>  - The USE_BX option is not needed: knowing whether BX is available or
>not is easy. If you have an ARM > v4 or ARMv4T, then BX is
>available, otherwise it's not. This is the logic used in glibc.
> 
>  - The USE_LDREXSTREX option is not needed: whenever Thumb2 is
>available, ldrex/strex are available, so we can simply rely on
>__thumb2__ to determine whether ldrex/strex should be used, without
>requiring a Config.in option.
> 
>  - Once USE_BX and USE_LDREXSTREX are removed, the only thing left
>that COMPILE_IN_THUMB does is to set -mthumb. This makes the option
>unnecessary, as on ARM at least, the user is already supposed to
>pass -march= or other compiler options tuning the library for
>a specific ARM variant. There is no reason to do otherwise for
>Thumb, which allows to get rid of the COMPILE_IN_THUMB option.
> 
> Signed-off-by: Thomas Petazzoni 

Applied and pushed.

Want to get the thread ARM noMMU problem analyzed and fixed before
the next release. Did you done any further testing?

 best regards
  Waldemar
___
uClibc mailing list
uClibc@uclibc.org
http://lists.busybox.net/mailman/listinfo/uclibc


new release 1.0.13 - Chimay Doree

2016-03-13 Thread Waldemar Brodkorb
Hi,

I cut down a new release today.

I've made some changes to the infrastructure of the project:
- Updated the project server to Debian/jessie
- Added a Github mirror: https://github.com/wbx-github/uclibc-ng
- All domains are available via SSL with letsencrypt certs
- All domains are reachable via IPv6
- Release files and GIT tags are signed with my GnuPG key
  http://www.waldemar-brodkorb.de/wbx.asc

Thanks you very much for all contributions and bug reports.

Release includes following changes:
Anton Kolesov (2):  


  Advertise obstack only when chosen


  ARC: Disable obstack  





Max Filippov (2):   


  xtensa: fix stack unwinding over __default_sa_restorer


  arm: fix __JMP_BUF_SP definition  





Peter Korsgaard (1):


  getaddrinfo: correct AI_V4MAPPED handling 





Thomas Claveirole (1):  


  include/netdb.h: Do not define IDN-related flags. 





Tim Hockin (2): 


  DNS: don't count search-path miss as a retry  


  DNS: Don't apply search domains to PTR lookups





Ubaldo Porcheddu (2):   


  Replaced any occurence of /bin/sh with _PATH_BSHELL to allow
easier portability on system with default shell on a different
directory, like for instance on android.  
  Replace /etc/resolv.conf with _PATH_RESCONF to allow
portability of the code on system where resolv.conf is not in /etc .
 


    
Waldemar Brodkorb (14): 


  mips: fix build if threa

Re: uClibc-ng 1.0.12 released

2016-02-01 Thread Waldemar Brodkorb
Hi,
Khem Raj wrote,

> On Mon, Feb 1, 2016 at 8:16 AM, Waldemar Brodkorb  wrote:
> > Hi Embedded Hackers,
> >
> > exactly one year after the first uClibc-ng release I finished with
> > the 13'th release of uClibc-ng. It contains a fix for a possible DoS
> > attack in the resolver code, so you should better update.
> >
> > The release contains various bugfixes and new features.
> 
> is there a shortlog published somewhere

http://mailman.uclibc-ng.org/pipermail/devel/2016-February/000709.html

The annotated tag, v1.0.12 has been updated
to  f4d92b79cd2845b5a8356d74fda5c29a4ab83f6b (tag)
  from  c83072523d320b04385bfeca3bcb50030931cbaa (which is now
obsolete)
   tagging  003b266cbeb370a8eae91dc256197f00798c6f93 (commit)
  replaces  v1.0.11
 tagged by  Waldemar Brodkorb
on  Mon Feb 1 16:39:51 2016 +0100

- Log
  -
release 1.0.12 - Chimay Brune

Leonid Lisovskiy (5):
  libdl: dlopen() mustn't forget RTLD_NODELETE flag
  tests: Extend OMIT LDFLAGS logic to test binaries too
  Provide __adjtimex() alias, like glibc.
  ldso: Fix fail of $ORIGIN expansion in case of RTLD_NOLOAD
  ldso: Use single rtld_flags interpretation through all the calls

Waldemar Brodkorb (11):
  Suppress warning "_GNU_SOURCE" redefined
  hppa: unbreak toolchain building
  test: disable tests requiring math headers
  nios2: allow to build toolchain
  add exp10() from glibc
  Do not follow compressed items forever.
  Make sure to always terminate decoded string
  add $ORIGIN test-case
  mips64: fix memcpy, patch from glibc
  mips: fix clashing symbols
  bump version for release

best regards
 Waldemar
___
uClibc mailing list
uClibc@uclibc.org
http://lists.busybox.net/mailman/listinfo/uclibc


uClibc-ng 1.0.12 released

2016-02-01 Thread Waldemar Brodkorb
Hi Embedded Hackers,

exactly one year after the first uClibc-ng release I finished with
the 13'th release of uClibc-ng. It contains a fix for a possible DoS
attack in the resolver code, so you should better update.

The release contains various bugfixes and new features.

Special thanks to Leonid Lisovskiy and Daniel Fahlgren doing some
code review regarding libdl and resolver code.

Test results for the testsuite will follow in the next days and can
be found here:
http://embedded-test.org/

best regards
 Waldemar
___
uClibc mailing list
uClibc@uclibc.org
http://lists.busybox.net/mailman/listinfo/uclibc


uClibc-ng - 1.0.11 released

2016-01-10 Thread Waldemar Brodkorb
Hi,

I just want to inform you, that uClibc-ng project released a new
version. Khem told me via IRC I should send the information to this
list, as a lot of projects are already using uClibc-ng instead of
uClibc.

release 1.0.11 - Tongerlo Blonde

Anthony G. Basile (1):
  extra/Configs/Config.in: add syncfs() to Linux-specific functions

Eugene Rudoy (1):
  ARCH_NATIVE_BIT should in the first place be passed when building utils 
for host

Leonid Lisovskiy (4):
  Fix "pselect: Use linux pselect6 syscall when available"
  inet/getaddrinfo: simplest /etc/gai.conf to control IPv6/IPv4 addresses 
sort order
  test/Test.mak: Properly define MAKE_SRCS variable
  linuxthreads.old: Implement pthread_tryjoin_np(), pthread_timedjoin_np()

Max Filippov (1):
  xtensa: fix vfork return address calculations

Salvatore Cro (1):
  Add argp implementation

Waldemar Brodkorb (21):
  Xtensa is biendian, allow to choose between the modes.
  remove deprecated architectures v850/i960
  remove attribute hidden, as the function is used in linuxthreads.old
  lm32: add missing types
  lm32: fix testsuite compile problems
  libc/pwd_grp: Allocate buffers for non-reentrant functions dynamically
  Use dynamic buffers for gethostent/gethostbyname/gethostbyaddr
  libc/inet: Unbreak gethostent()
  remove pregenerated locale support, we don't support it
  libc: getpass,getutent: allocate buffer dynamically
  pthread_atfork handlers not removed during dlclose
  disable always failing tst-signal7
  fix compile with DODEBUG=y
  test-skeleton: Fixes from glibc
  Provide XTI __t_scalar_t types, like glibc
  Implement legacy bcopy/bzero/bcmp/index/rindex as inline functions
  Add implementation for copysignl for i386
  NPTL: Fix __pthread_once old style declaration
  NPTL: fix infinite recursion
  order of special checks matters
  bump version for release

Yoshinori Sato (5):
  h8300: vfork flags update.
  __ARCH_HAS_DEPRECATED_SYSCALLS__ case fix. getdents is deprecated.
  openat argument fix.
  Remove alias.
  h8300: O_DIRECT and O_DIRECTORY swapping.

have fun,

 Waldemar

P.s: the beer was delicious ;)

___
uClibc mailing list
uClibc@uclibc.org
http://lists.busybox.net/mailman/listinfo/uclibc


Re: [PATCH] Enable mips32r6 and mips64r6 builds.

2015-12-23 Thread Waldemar Brodkorb
Hi Steve,

Steve Ellcey wrote,

> This patch adds mips32r6 and mips64r6 architecture options to the MIPS
> build.

so this enables mips32r6 and mips64r6 in uClibc.
Is there any embedded board I could use to test these?
I think my recent MIPS board CI20 is MIPS32r2. So what options do
I have?

BTW: Many thanks for adding support!!

best regards
 Waldemar

___
uClibc mailing list
uClibc@uclibc.org
http://lists.busybox.net/mailman/listinfo/uclibc


Re: [PATCH] pselect: Use linux pselect syscall when available

2015-12-19 Thread Waldemar Brodkorb
Hi Nicolas,
Nicolas S. Dade wrote,

> This supercedes the previous pselect patch from 16 Dec 2015.

Can you resend next time with PATCH v3 in the subject and
a short Changelog after the comment ---. Thanks.

What you think about Rich comment?

best regards
 Waldemar
___
uClibc mailing list
uClibc@uclibc.org
http://lists.busybox.net/mailman/listinfo/uclibc


Re: [PATCH] pselect: Use linux pselect syscall when available

2015-12-17 Thread Waldemar Brodkorb
Hi Nicolas,
Nicolas S. Dade wrote,

> Linux has a pselect syscall since 2.6.something. Using it
> rather than emulating it with sigprocmask+select+sigprocmask
> is smaller code, and works properly. (The emulation has
> race conditions when unblocked signals arrive before or
> after the select)

Did you see the race condition in real code or do you have 
a testcase for it?

best regards
 Waldemar
 
___
uClibc mailing list
uClibc@uclibc.org
http://lists.busybox.net/mailman/listinfo/uclibc


Re: [PATCH 1/2] libc: fix setting return value and errno in fallocate()

2015-09-16 Thread Waldemar Brodkorb
Hi Yuriy,

can you explain why these patches are useful?
Better standard conformance? Testsuite or runtime fixes?

Thanks
 Waldemar

Yuriy Kolerov wrote,

> Signed-off-by: Yuriy Kolerov 
> ---
>  libc/sysdeps/linux/common/fallocate.c   | 13 -
>  libc/sysdeps/linux/common/fallocate64.c | 11 +++
>  2 files changed, 15 insertions(+), 9 deletions(-)
> 
> diff --git a/libc/sysdeps/linux/common/fallocate.c 
> b/libc/sysdeps/linux/common/fallocate.c
> index b231226..97ac303 100644
> --- a/libc/sysdeps/linux/common/fallocate.c
> +++ b/libc/sysdeps/linux/common/fallocate.c
> @@ -12,6 +12,7 @@
>  #include 
>  #include 
>  #include 
> +#include 
>  
>  #if defined __NR_fallocate
>  extern __typeof(fallocate) __libc_fallocate attribute_hidden;
> @@ -26,17 +27,19 @@ int attribute_hidden __libc_fallocate(int fd, int mode, 
> __off_t offset, __off_t
>   uint32_t zero = 0;
>   INTERNAL_SYSCALL_DECL(err);
>   ret = (int) (INTERNAL_SYSCALL(fallocate, err, 6, fd, mode,
> - __LONG_LONG_PAIR (zero, off_low),
> - __LONG_LONG_PAIR (zero, len_low)));
> + __LONG_LONG_PAIR(zero, off_low),
> + __LONG_LONG_PAIR(zero, len_low)));
>  # elif __WORDSIZE == 64
>   INTERNAL_SYSCALL_DECL(err);
>   ret = (int) (INTERNAL_SYSCALL(fallocate, err, 4, fd, mode, offset, 
> len));
>  # else
>  # error your machine is neither 32 bit or 64 bit ... it must be magical
>  # endif
> - if (unlikely(INTERNAL_SYSCALL_ERROR_P (ret, err)))
> - return INTERNAL_SYSCALL_ERRNO (ret, err);
> - return 0;
> + if (unlikely(INTERNAL_SYSCALL_ERROR_P(ret, err))) {
> + __set_errno(INTERNAL_SYSCALL_ERRNO(ret, err));
> + ret = -1;
> + }
> + return ret;
>  }
>  
>  # if defined __UCLIBC_LINUX_SPECIFIC__ && defined __USE_GNU
> diff --git a/libc/sysdeps/linux/common/fallocate64.c 
> b/libc/sysdeps/linux/common/fallocate64.c
> index cf75693..d051d37 100644
> --- a/libc/sysdeps/linux/common/fallocate64.c
> +++ b/libc/sysdeps/linux/common/fallocate64.c
> @@ -13,6 +13,7 @@
>  #include 
>  #include 
>  #include 
> +#include 
>  
>  #if defined __NR_fallocate
>  
> @@ -26,10 +27,12 @@ int attribute_hidden __libc_fallocate64(int fd, int mode, 
> __off64_t offset,
>   int ret;
>   INTERNAL_SYSCALL_DECL(err);
>   ret = (int) (INTERNAL_SYSCALL(fallocate, err, 6, fd, mode,
> - OFF64_HI_LO (offset), OFF64_HI_LO (len)));
> - if (unlikely(INTERNAL_SYSCALL_ERROR_P (ret, err)))
> - return INTERNAL_SYSCALL_ERRNO (ret, err);
> - return 0;
> + OFF64_HI_LO(offset), OFF64_HI_LO(len)));
> + if (unlikely(INTERNAL_SYSCALL_ERROR_P(ret, err))) {
> + __set_errno(INTERNAL_SYSCALL_ERRNO(ret, err));
> + ret = -1;
> + }
> + return ret;
>  }
>  
>  #  if defined __UCLIBC_LINUX_SPECIFIC__ && defined __USE_GNU
> -- 
> 2.2.0
> 
> ___
> uClibc mailing list
> uClibc@uclibc.org
> http://lists.busybox.net/mailman/listinfo/uclibc
> 
___
uClibc mailing list
uClibc@uclibc.org
http://lists.busybox.net/mailman/listinfo/uclibc


Re: How to recover uclibc config ?

2015-06-08 Thread Waldemar Brodkorb
Hi Jarek,
jarek wrote,

> Hello!
> 
>   I'm trying to create toolchain with uClibc. crosstool-ng, wants from me
> uClibc config file. How can I create this config file if I have only
> binary uClibc ?

In short: not possible in my opinion.
Just create a config with make menuconfig from scratch, and see
later if you are missing any features or compatibility stuff.

best regards
 Waldemar
___
uClibc mailing list
uClibc@uclibc.org
http://lists.busybox.net/mailman/listinfo/uclibc


Re: Segmentation fault in __uClibc_main on m68k

2015-05-30 Thread Waldemar Brodkorb
Hi,
Rob Landley wrote,

> Of course somebody did a uclibc-ng fork (bought the domain name and
> everything), but I talked to him and his reason for doing it is there
> are some obscure targets even glibc doesn't support, and I expect that
> as musl grows support for those targets his reasons for doing it will
> gradually fade away. *shrug* We'll see.

We'll see. In the FPGA world there are four main architectures, 
NIOS2, ARC, Microblaze and Xtensa. Nios2 and Microblaze are
supported by GNU libc. ARC and Xtensa are only supported by
uClibc/uClibc-ng. There are nice developers and company's behind.

For all the no-MMU architectures or systems there is only one option
at the moment. uClibc/uClibc-ng!

I am maintaining an developing buildsystems for embedded devices
since more than 10 years, I don't think I will give up on uClibc-ng
so fast.
 
> Remember when buildroot announced they would switch their default libc
> if the uClibc developers couldn't get a new release out? Remember how
> that was over a year ago, ala
> http://lists.busybox.net/pipermail/uclibc/2014-February/048252.html ?
> Well instead what happened was
> http://lists.busybox.net/pipermail/buildroot/2013-October/079661.html
> became 
> http://git.buildroot.net/buildroot/commit/?id=c29799330464fb5d152f1b3d550fcbda69c58a3d
> which became 
> https://www.phoronix.com/scan.php?page=news_item&px=Musl-Libc-GCC-Support
> and at this point it's pretty much over except the cleanup. They
> didn't _announce_ a migration, they just did it. At this point if
> uClibc had a new release I expect they'd smile and nod and _continue_
> not to care because there are better alternatives now, once that
> haven't established a pattern of chronic multi-year development
> constipation.

That is not correct. They did not silently migrate to musl.
Musl is a choice like Gnu Libc in their buildsystem.

They will migrate in the next release cycle, but they migrate to
uClibc-ng as default C library for their system.

This will get a better code coverage, than my own embedded-test
project, which at the moment only running the uClibc-ng testsuite
regulary. 

But may be Rob comes up with nommu.org contents with a musl 
libc for at least sh2 nommu, soon.


Best choice for exotic architectures and hardware is OpenADK + uCLibc-ng ;)


best regards and happy hacking,
 Waldemar
___
uClibc mailing list
uClibc@uclibc.org
http://lists.busybox.net/mailman/listinfo/uclibc


Re: Segmentation fault in __uClibc_main on m68k

2015-05-30 Thread Waldemar Brodkorb
Hi,
Bernhard Reutner-Fischer wrote,

> On 29 May 2015 at 17:54, Jaromír Cápík  wrote:
> 
> > You mentioned a distro you boottrapped a couple of weeks
> > ago. Do you have a working rootfs environment I could
> > test?
> 
> I did not submit the m68k patch to OE yet since i meant to get gmp
> going first, no.
> 
> Buildroot, Alpine-linux or gentoo come to mind, i'd try these with
> current uClibc master.

The m68k support in buildroot is disabled. I sent a patch to enable
it for m68k targeting Aranym, but it needs some more work to be
accepted.

Alpine-Linux switched to musl libc and musl has no m68k support.
Alpine-Linux never had support for m68k.

Gentoo has some 2 years old stage3 images lying around. Dunno.

The best option you have is to use OpenADK.
OpenADK uses uClibc-ng (spinoff of uClibc master) and has support
for targeting Aranym (68040 CPU) or Qemu-M68K with Coldfire no-MMU
CPU. I am planning to add support for a coldfire board and an old 
m68k based laptop for real hardware testing.

best regards
 Waldemar
___
uClibc mailing list
uClibc@uclibc.org
http://lists.busybox.net/mailman/listinfo/uclibc

testsuite problem with tst-cancel4

2015-05-29 Thread Waldemar Brodkorb
Hi,

I think since this commit:

commit 7c721d31e4b7a0bdf6f803b8e7c38996bf60b59f
Author: Bernhard Reutner-Fischer 
Date:   Sun Jan 29 17:48:54 2012 +0100

tmpnam, tempnam are obsolete in SUSV4

Signed-off-by: Bernhard Reutner-Fischer 

-

the test case is broken. mkstemp opens the temporary file, mktemp
does not.

Strace shows following issue:
socket(PF_FILE, SOCK_STREAM, 0) = 3
getpid()= 12607
open("/tmp/tst-cancel4-socket-1-9PTGfr", O_RDWR|O_CREAT|O_EXCL, 0600) = 4
close(4)= 0
bind(3, {sa_family=AF_FILE, path="/tmp/tst-cancel4-socket-1-9PTGfr"}, 35) = -1 
EADDRINUSE
(Address already in use)
open("/tmp/tst-cancel4-socket-1-cHm3px", O_RDWR|O_CREAT|O_EXCL, 0600) = 4
close(4)= 0
bind(3, {sa_family=AF_FILE, path="/tmp/tst-cancel4-socket-1-cHm3px"}, 35) = -1 
EADDRINUSE
(Address already in use)

mkstemp() creates the file, and bind() returns EADDRINUSE, if the 
file already exists.

Return to mktemp usage as glibc does for this testcase?

best regards
 Waldemar

___
uClibc mailing list
uClibc@uclibc.org
http://lists.busybox.net/mailman/listinfo/uclibc


Re: Question: Does uclibc support NPTL TLS ?

2015-05-27 Thread Waldemar Brodkorb
Hi,
Sheng Yong wrote,

> Hi,
> 
> I encountered a problem when I test thread local storage
> on my arm board (kernel 3.10.77 and uclibc 0.99.3.2).
> 
> Please let me know if I am doing something wrong for
> debugging TLS.

You mean 0.9.33.2?
Sure it has NPTL/TLS support, but it depends if it is
configured in or not. uClibc support linuxthreads, linuxthreads-new
and NPTL for ARM. So it depends how it got configured.
 
> on my x86 host machine:
> root@kernel-host:~> cat tls.c
> __thread int i =5;
> 
> int
> main (int argc, char **argv)
> {
>   return 0;
> }
> 
> root@kernel-host:~> arm-linux-uclibceabi-gcc -o tls tls.c -g -lpthread
> 
> on my arm board:
> -bash-4.2# gdb ./tls
> GNU gdb (GDB) 7.6
> Copyright (C) 2013 Free Software Foundation, Inc.
> License GPLv3+: GNU GPL version 3 or later 
> This is free software: you are free to change and redistribute it.
> There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
> and "show warranty" for details.
> This GDB was configured as "arm-euler-linux-uclibceabi".
> For bug reporting instructions, please see:
> ...
> Reading symbols from /tmp/zz/tls...done.
> (gdb) b main
> Breakpoint 1 at 0x8518: file tls.c, line 6.
> (gdb) r
> Starting program: /tmp/zz/tls
> [Thread debugging using libthread_db enabled]
> Using host libthread_db library "/lib/libthread_db.so.1".
> 
> Breakpoint 1, main (argc=1, argv=0xbefffd84) at tls.c:6
> 6 tls.c: No such file or directory.
> (gdb) whatis i
> type = int
> (gdb) p i
> Cannot find thread-local storage for Thread 0xb6ffb000 (LWP 538), executable 
> file /tmp/zz/tls:
> *capability not available*
> (gdb)

Strange error. 

best regards
 Waldemar
___
uClibc mailing list
uClibc@uclibc.org
http://lists.busybox.net/mailman/listinfo/uclibc


Re: [Buildroot] uClibc build verbosity control

2015-04-27 Thread Waldemar Brodkorb
Hi Vineet,
Vineet Gupta wrote,

> Hi,
> 
> uClibc verbosity control V=xx is different from other mainstream projects: 
> namely Busybox and Linux kernel.
> To print full cmdlines (when debugging obscure toolchain issues) we need to 
> pass V=2 whereas kernel/busybox take V=1.
> 
> Can this be changed (I can provide a patch) assuming this doesn't break 
> existing scripts upsetting some people.
> 
> My issue is specifically when using likes of Buildroot, there's no obvious 
> way to get the cmdlines of uClibc and/or other projects (unless there's some 
> obvious way I'm missing).

Good idea. Send a patch. I am pro.

best regards
 Waldemar
___
uClibc mailing list
uClibc@uclibc.org
http://lists.busybox.net/mailman/listinfo/uclibc


problem cross-compiling for i686

2015-04-11 Thread Waldemar Brodkorb
Hi,

while trying to compile latest git for qemu-i386 (i686),
I get following error:
/home/wbx/openadk/toolchain_qemu-x86_uclibc_i686/usr/bin/i686-openadk-linux-uclibc-gcc
-Wl,-EL -Wl,--sort-common -Wl,--sort-section=alignment -m32 -shared
-Wl,--warn-common -Wl,--warn-once -Wl,-z,combreloc -Wl,-z,relro
-Wl,-z,now -Wl,-z,defs   -Wl,-soname=librt.so.0 -nostdlib -o
lib/librt-0.9.34-git.so  -Wl,--whole-archive librt/librt_so.a
-Wl,--no-whole-archive ./lib/interp.os -L./lib ./lib/libc.so
./lib/libdl.so ./lib/libpthread.so
/home/wbx/openadk/toolchain_qemu-x86_uclibc_i686/usr/lib/gcc/i686-openadk-linux-uclibc/4.9.2/libgcc.a
/home/wbx/openadk/toolchain_qemu-x86_uclibc_i686/usr/lib/gcc/i686-openadk-linux-uclibc/4.9.2/../../../../i686-openadk-linux-uclibc/bin/ld:
./lib/libpthread_nonshared.a(pthread_atfork.oS): relocation
R_386_GOTOFF against undefined hidden symbol `__dso_handle' can not
be used when making a shared object
/home/wbx/openadk/toolchain_qemu-x86_uclibc_i686/usr/lib/gcc/i686-openadk-linux-uclibc/4.9.2/../../../../i686-openadk-linux-uclibc/bin/ld:
final link failed: Bad value
collect2: error: ld returned 1 exit status
make[5]: *** [lib/librt.so] Error 1
make[5]: Leaving directory
`/home/wbx/openadk/toolchain_build_qemu-x86_uclibc_i686/w-uClibc-0.9.34-git-1/uClibc-0.9.34-git'

Config attached.

best regards
 Waldemar
#
# Automatically generated file; DO NOT EDIT.
# uClibc 0.9.34-git C Library Configuration
#
# TARGET_alpha is not set
# TARGET_arc is not set
# TARGET_arm is not set
# TARGET_avr32 is not set
# TARGET_bfin is not set
# TARGET_c6x is not set
# TARGET_cris is not set
# TARGET_e1 is not set
# TARGET_frv is not set
# TARGET_h8300 is not set
# TARGET_hppa is not set
TARGET_i386=y
# TARGET_i960 is not set
# TARGET_ia64 is not set
# TARGET_m68k is not set
# TARGET_metag is not set
# TARGET_microblaze is not set
# TARGET_mips is not set
# TARGET_nios is not set
# TARGET_nios2 is not set
# TARGET_powerpc is not set
# TARGET_sh is not set
# TARGET_sh64 is not set
# TARGET_sparc is not set
# TARGET_v850 is not set
# TARGET_vax is not set
# TARGET_x86_64 is not set
# TARGET_xtensa is not set

#
# Target Architecture Features and Options
#
TARGET_ARCH="i386"
FORCE_OPTIONS_FOR_ARCH=y
# CONFIG_386 is not set
# CONFIG_486 is not set
# CONFIG_586 is not set
CONFIG_686=y
TARGET_SUBARCH="i686"

#
# Using ELF file format
#
ARCH_HAS_DEPRECATED_SYSCALLS=y
ARCH_LITTLE_ENDIAN=y

#
# Using Little Endian
#
ARCH_HAS_MMU=y
ARCH_USE_MMU=y
UCLIBC_HAS_FLOATS=y
UCLIBC_HAS_FPU=y
DO_C99_MATH=y
# DO_XSI_MATH is not set
UCLIBC_HAS_FENV=y
UCLIBC_HAS_LONG_DOUBLE_MATH=y
KERNEL_HEADERS="/home/wbx/openadk/target_qemu-x86_uclibc_i686/usr/include"
HAVE_DOT_CONFIG=y

#
# General Library Settings
#
DOPIC=y
ARCH_HAS_UCONTEXT=y
HAVE_SHARED=y
# FORCE_SHAREABLE_TEXT_SEGMENTS is not set
LDSO_LDD_SUPPORT=y
LDSO_CACHE_SUPPORT=y
# LDSO_PRELOAD_ENV_SUPPORT is not set
# LDSO_PRELOAD_FILE_SUPPORT is not set
LDSO_BASE_FILENAME="ld.so"
# LDSO_STANDALONE_SUPPORT is not set
# LDSO_PRELINK_SUPPORT is not set
# UCLIBC_STATIC_LDCONFIG is not set
LDSO_RUNPATH=y
# LDSO_RUNPATH_OF_EXECUTABLE is not set
LDSO_SAFE_RUNPATH=y
LDSO_SEARCH_INTERP_PATH=y
LDSO_LD_LIBRARY_PATH=y
LDSO_NO_CLEANUP=y
UCLIBC_CTOR_DTOR=y
# LDSO_GNU_HASH_SUPPORT is not set
# HAS_NO_THREADS is not set
# LINUXTHREADS_OLD is not set
# LINUXTHREADS_NEW is not set
UCLIBC_HAS_THREADS_NATIVE=y
UCLIBC_HAS_THREADS=y
UCLIBC_HAS_TLS=y
PTHREADS_DEBUG_SUPPORT=y
UCLIBC_HAS_SYSLOG=y
UCLIBC_HAS_LFS=y
MALLOC=y
# MALLOC_SIMPLE is not set
# MALLOC_STANDARD is not set
MALLOC_GLIBC_COMPAT=y
UCLIBC_HAS_OBSTACK=y
UCLIBC_DYNAMIC_ATEXIT=y
COMPAT_ATEXIT=y
UCLIBC_HAS_UTMPX=y
UCLIBC_HAS_UTMP=y
UCLIBC_SUSV2_LEGACY=y
UCLIBC_SUSV3_LEGACY=y
# UCLIBC_HAS_CONTEXT_FUNCS is not set
# UCLIBC_SUSV3_LEGACY_MACROS is not set
UCLIBC_SUSV4_LEGACY=y
# UCLIBC_STRICT_HEADERS is not set
# UCLIBC_HAS_STUBS is not set
UCLIBC_HAS_SHADOW=y
UCLIBC_HAS_PROGRAM_INVOCATION_NAME=y
UCLIBC_HAS___PROGNAME=y
UCLIBC_HAS_PTY=y
ASSUME_DEVPTS=y
UNIX98PTY_ONLY=y
UCLIBC_HAS_GETPT=y
UCLIBC_HAS_LIBUTIL=y
UCLIBC_HAS_TM_EXTENSIONS=y
UCLIBC_HAS_TZ_CACHING=y
UCLIBC_HAS_TZ_FILE=y
UCLIBC_HAS_TZ_FILE_READ_MANY=y
UCLIBC_TZ_FILE_PATH="/etc/TZ"
UCLIBC_FALLBACK_TO_ETC_LOCALTIME=y

#
# Advanced Library Settings
#
UCLIBC_PWD_BUFFER_SIZE=256
UCLIBC_GRP_BUFFER_SIZE=256

#
# Support various families of functions
#
UCLIBC_LINUX_MODULE_26=y
# UCLIBC_LINUX_MODULE_24 is not set
UCLIBC_LINUX_SPECIFIC=y
UCLIBC_HAS_GNU_ERROR=y
UCLIBC_BSD_SPECIFIC=y
UCLIBC_HAS_BSD_ERR=y
UCLIBC_HAS_OBSOLETE_BSD_SIGNAL=y
# UCLIBC_HAS_OBSOLETE_SYSV_SIGNAL is not set
# UCLIBC_NTP_LEGACY is not set
UCLIBC_SV4_DEPRECATED=y
UCLIBC_HAS_REALTIME=y
UCLIBC_HAS_ADVANCED_REALTIME=y
UCLIBC_HAS_EPOLL=y
UCLIBC_HAS_XATTR=y
# UCLIBC_HAS_PROFILING is not set
UCLIBC_HAS_CRYPT_IMPL=y
# UCLIBC_HAS_SHA256_CRYPT_IMPL is not set
# UCLIBC_HAS_SHA512_CRYPT_IMPL is not set
UCLIBC_HAS_CRYPT=y
UCLIBC_HAS_NETWORK_SUPPORT=y
UCLIBC_HAS_SOCKET=y
UCLIBC_HAS_IPV4=y
UCLIBC_HAS_IPV6=y
# UCLIBC_HAS_RPC is not set
UCLIBC_USE_NETLINK

Re: is ARMv4T deprecated?

2015-04-06 Thread Waldemar Brodkorb
Hi,
Sergiy Kibrik wrote,

> hi All,
> Recently I've been trying to use uClibc for quite old arm920t-based
> board. Some busybox applications (like shell, mount, hostname, wget)
> would get killed with SIGILL. I managed to debug it down to leaving
> memcpy() routine, namely to the following code from
> libc/string/arm/memcpy.S:
> 
> [..]
> .thumb_func
> memcpy:
>   push{r0, lr}
>   bl  _memcpy
>   POP_RET
> [..]
> 
> POP_RET defined as pop {r2, pc} in [1]. On armv4t is just won't switch
> CPU back to arm mode, so in my case it seems to be jumping to calling
> arm routine while still being in thumb mode.
> 
> I'm not sure if this is the case, but I've also found couple of comments
> in code:
> http://git.uclibc.org/uClibc/tree/ldso/ldso/arm/resolve.S#n62
> http://git.uclibc.org/uClibc/tree/libc/sysdeps/linux/arm/crtn.S#n10
> 
> stating that some parts aren't even supposed to work on armv4t.
> Has armv4t been deprecated for good (I use master branch currently)?
> Thanks.

Does it work with uClibc 0.9.33 release?
What board is this?
Are you tried running thumb-only?

best regards
 Waldemar 

___
uClibc mailing list
uClibc@uclibc.org
http://lists.busybox.net/mailman/listinfo/uclibc


testsuite compile break in master

2015-03-28 Thread Waldemar Brodkorb
Hi,

the testsuite does not compile anymore:
qemu-sparc_uclibc_sparc/usr/include/ -isystem
/home/wbx/adk/toolchain_qemu-sparc_uclibc_sparc/usr/lib/gcc/sparc-openadk-linux-uclibc/4.9.2/include-fixed
-isystem
/home/wbx/adk/toolchain_qemu-sparc_uclibc_sparc/usr/lib/gcc/sparc-openadk-linux-uclibc/4.9.2/include
-Os -fstrict-aliasing -funsigned-char -fno-builtin -fno-asm
-std=gnu99 -mcpu=v8 -Wall -Wstrict-prototypes -Wstrict-aliasing
-Wstrict-prototypes -Wno-missing-field-initializers-c
tst-atomic.c -o tst-atomic.o
tst-atomic.c:21:20: fatal error: atomic.h: No such file or directory
 #include 

grep THREAD
toolchain_build_qemu-sparc_uclibc_sparc/w-uClibc-0.9.34-git-1/uClibc-0.9.34-git/.config

# HAS_NO_THREADS is not set
# LINUXTHREADS_OLD is not set
# LINUXTHREADS_NEW is not set
UCLIBC_HAS_THREADS_NATIVE=y
UCLIBC_HAS_THREADS=y
PTHREADS_DEBUG_SUPPORT=y

UCLIBC_HAS_THREADS_NATIVE is active, but atomic.h is not installed.

Any idea?

best regards
 Waldemar
___
uClibc mailing list
uClibc@uclibc.org
http://lists.busybox.net/mailman/listinfo/uclibc


Re: sh4 build break

2015-03-27 Thread Waldemar Brodkorb
Hi,
Bernhard Reutner-Fischer wrote,

> On March 24, 2015 12:20:51 AM GMT+01:00, Bernhard Reutner-Fischer 
>  wrote:
> >On March 23, 2015 9:10:05 AM GMT+01:00, Waldemar Brodkorb
> > wrote:
> >>Hi,
> >>
> >>the latest git does not compile anymore:
> >
> >>-MT libm/cosl.os -MD -MP -MF libm/.cosl.os.dep -DL_cosl
> >>In file included from :0:0:
> >>./include/libc-symbols.h:494:25: error: '__EI_cosl' aliased to
> >>undefined symbol '__GI_cosl'
> >
> >There are a couple of related warnings before that function, fwiw.
> >
> >Please try current master.
> 
> I pushed further SH tweaks to master now, FYI. In theory I have 2 more SH 
> fixes pending but cannot readily test them so these will have to wait for now.

You might consider to send them to the list for review or testing.

Thanks for the fast fix. Works for me now.

best regards
 Waldemar
___
uClibc mailing list
uClibc@uclibc.org
http://lists.busybox.net/mailman/listinfo/uclibc


sh4 build break

2015-03-23 Thread Waldemar Brodkorb
Hi,

the latest git does not compile anymore:
/home/wbx/uclibc-git-adk/toolchain_qemu-sh_uclibc_sh4/usr/bin/sh4-openadk-linux-uclibc-gcc
-c libm/ldouble_wrappers.c -o libm/cosl.os -Wall -Wstrict-prototypes
-Wstrict-aliasing -funsigned-char -fno-builtin -fno-asm -std=gnu99
-ml -m4 -fno-stack-protector -nostdinc -I./include -I./include
-include libc-symbols.h -I./libc/sysdeps/linux/sh
-I./libc/sysdeps/linux -I./ldso/ldso/sh -I./ldso/include -I. -Os
-fstrict-aliasing -mprefergot -fwrapv -fno-ident -fhonour-copts -Os
-pipe -g3 -fomit-frame-pointer -fno-unwind-tables
-fno-asynchronous-unwind-tables -D__USE_STDIO_FUTEXES__
-DHAVE_FORCED_UNWIND -D_LIBC_REENTRANT -I./libpthread/nptl
-I./libpthread/nptl
-I./libpthread/nptl/sysdeps/unix/sysv/linux/sh/sh4
-I./libpthread/nptl/sysdeps/unix/sysv/linux/sh
-I./libpthread/nptl/sysdeps/sh -I./libpthread/nptl/sysdeps/sh
-I./libpthread/nptl/sysdeps/unix/sysv/linux
-I./libpthread/nptl/sysdeps/unix/sysv/linux
-I./libpthread/nptl/sysdeps/pthread
-I./libpthread/nptl/sysdeps/pthread/bits
-I./libpthread/nptl/sysdeps/generic -I./libc/sysdeps/linux/common
-isystem
/home/wbx/uclibc-git-adk/toolchain_qemu-sh_uclibc_sh4/usr/lib/gcc/sh4-openadk-linux-uclibc/4.8.4/include-fixed
-isystem
/home/wbx/uclibc-git-adk/toolchain_qemu-sh_uclibc_sh4/usr/lib/gcc/sh4-openadk-linux-uclibc/4.8.4/include
-I/home/wbx/uclibc-git-adk/target_qemu-sh_uclibc_sh4/usr/include/
-DNDEBUG -DNOT_IN_libc -DIS_IN_libm -D_IEEE_LIBM -DIN_LIB=libm -fPIC
-MT libm/cosl.os -MD -MP -MF libm/.cosl.os.dep -DL_cosl
In file included from :0:0:
./include/libc-symbols.h:494:25: error: '__EI_cosl' aliased to
undefined symbol '__GI_cosl'
  extern __typeof (name) __EI_##name __attribute__((alias
(__hidden_asmname1 (,#local
 ^
./include/libc-symbols.h:497:29: note: in expansion of macro
'__hidden_ver1'
 #  define hidden_def(name)  __hidden_ver1(__GI_##name, name, name);
 ^
./include/libc-symbols.h:632:32: note: in expansion of macro
'hidden_def'
 # define libm_hidden_def(name) hidden_def (name)
^
libm/ldouble_wrappers.c:168:1: note: in expansion of macro
'libm_hidden_def'
 libm_hidden_def(cosl)
 ^
make[5]: *** [libm/cosl.os] Error 1

I can provide a .config if needed for reproduction of the problem.
best regards
 Waldemar

___
uClibc mailing list
uClibc@uclibc.org
http://lists.busybox.net/mailman/listinfo/uclibc


Re: 0.9.33 branch development / release process

2015-03-01 Thread Waldemar Brodkorb
Hi Bernhard,
Bernhard Reutner-Fischer wrote,

> On February 6, 2015 12:04:30 AM GMT+01:00, Bernhard Reutner-Fischer 
>  wrote:
> >On February 5, 2015 6:57:53 PM GMT+01:00, Andy Voltz
> > wrote:
> >>What is the current release process for uClibc?
> >>
> >>I'm looking to bump our build system to a newer uClibc version, but
> >>there
> >>are no new release tags since 0.9.33.2. It seems like the 0.9.33
> >branch
> >>could be treated as version 0.9.33.3, but there was never a tag, and
> >
> >We will have a 0.9.33.3 off the 0.9.33 branch.
> >
> >>now
> >>master is 0.9.33.4-git.
> >>
> >>Is the process to create a branch for the version once it's
> >development
> >>is
> >>complete? I'd rather not use 0.9.33 branch if it is some abandoned /
> >>unstable effort, but at the same time the master branch seems active
> >>enough
> >>to not treat as a stable release.
> >
> >I consider master pretty stable and intend to have a new stable release
> >of a 0.9.34 off master hopefully this month.
> 
> Changing babies nappies let's make this start of march...
> 
> m68k still hitting .sgot binutils asserts though but on the plus side major 
> arches seem to do well, from cursory testing.
> Thanks,

Did you try to use -fPIC to compile the code for m68k?
It helped me to get the testsuite compile without binutils asserts.

best regards
 Waldemar

___
uClibc mailing list
uClibc@uclibc.org
http://lists.busybox.net/mailman/listinfo/uclibc


Re: executable RPATH question

2015-02-05 Thread Waldemar Brodkorb
Hi Steve,
Steve Ellcey  wrote,

> While building uclibc for MIPS I ran into the issue of whether or not
> the dynamic linker should use an executables rpath when searching for
> its libraries.  Apparently the glibc dynamic linker does this, but the
> uclibc one does not and back when this was discussed in 2011 the decision
> was made not to change the uclibc behaviour because the ELF spec does not
> say that the linker should do this.
> 
> At the risk of of reopening a closed issue I was wondering if we could
> consider putting the code to do this in under an ifdef or a config option
> so that those of us who want it could have it without having to maintain
> a local patch for it.  If not, I will just maintain my local patch.
> 
> Original discussion:
> 
> http://lists.uclibc.org/pipermail/uclibc/2011-September/045757.html

Do you have a patch which applies to master?
Including an option...

best regards
 Waldemar
___
uClibc mailing list
uClibc@uclibc.org
http://lists.busybox.net/mailman/listinfo/uclibc


tests are failing

2014-12-19 Thread Waldemar Brodkorb
Hi Bernhard,

after your commit
http://git.uclibc.org/uClibc/commit/?id=067637375658047d70c296606ae17ef0bc86499d
tst-cancel7x and others are failing.
You changed the getopt handling, but not how the tests are called.
http://git.uclibc.org/uClibc/tree/test/nptl/tst-cancel7.c?id=067637375658047d70c296606ae17ef0bc86499d#n35

best regards
 Waldemar

___
uClibc mailing list
uClibc@uclibc.org
http://lists.busybox.net/mailman/listinfo/uclibc


Re: [PATCH] mkostemp: fix implementation

2014-12-09 Thread Waldemar Brodkorb
Hi Anthony,
Anthony G. Basile wrote,

> On 12/08/14 13:31, Waldemar Brodkorb wrote:
> >Hi Anthony,
> >
> >I tried your patch, but I have a minor issue when building the added
> >tests on noMMU (like Blackfin):
> 
> Thanks.  This is just a test but let me look at this wrt to noMMU
> and see what can be done.  You can probably avoid the fork but you
> need the exec because that's the whole point of O_CLOEXEC.

If you believe the test make no sense with noMMU, I am happy if you
just disable it for noMMU targets.

best regards
 Waldemar
 
___
uClibc mailing list
uClibc@uclibc.org
http://lists.busybox.net/mailman/listinfo/uclibc


Re: [PATCH] mkostemp: fix implementation

2014-12-08 Thread Waldemar Brodkorb
Hi Anthony,

I tried your patch, but I have a minor issue when building the added
tests on noMMU (like Blackfin):

/home/wbx/embedded-test/openadk/toolchain_toolchain-bfin_uclibc-ng_bfin/usr/bin/bfin-openadk-linux-uclibc-gcc
-nostdinc -I../../install_dir/usr/include -I../../test -D_GNU_SOURCE
-I/home/wbx/embedded-test/openadk/target_toolchain-bfin_uclibc-ng_bfin/usr/include/
-isystem
/home/wbx/embedded-test/openadk/toolchain_toolchain-bfin_uclibc-ng_bfin/usr/lib/gcc/bfin-openadk-linux-uclibc/4.5.4/include-fixed
-isystem
/home/wbx/embedded-test/openadk/toolchain_toolchain-bfin_uclibc-ng_bfin/usr/lib/gcc/bfin-openadk-linux-uclibc/4.5.4/include
-Os -fstrict-aliasing -mfdpic -Wall -Wstrict-prototypes
-Wstrict-aliasing -Wstrict-prototypes-c
test-mkostemp-O_CLOEXEC.c -o test-mkostemp-O_CLOEXEC.o
test-mkostemp-O_CLOEXEC.c: In function 'main':
test-mkostemp-O_CLOEXEC.c:21:5: warning: implicit declaration of
function 'fork'
/home/wbx/embedded-test/openadk/toolchain_toolchain-bfin_uclibc-ng_bfin/usr/bin/bfin-openadk-linux-uclibc-gcc
-Wl,-EL -Wl,-melf32bfinfd -Wl,-z,now -Wl,-s
-Wl,-rpath,/home/wbx/embedded-test/openadk/toolchain_build_toolchain-bfin_uclibc-ng_bfin/w-uClibc-ng-1.0.0-1/uClibc-ng-1.0.0/test/stdlib
-Wl,--dynamic-linker,/lib//ld-uClibc.so.1 test-mkostemp-O_CLOEXEC.o
-o test-mkostemp-O_CLOEXEC
test-mkostemp-O_CLOEXEC.o: In function `_main':
test-mkostemp-O_CLOEXEC.c:(.text+0x46): undefined reference to
`_fork'
collect2: ld returned 1 exit status
make[7]: *** [test-mkostemp-O_CLOEXEC] Error 1

Avoid the test on noMMU or is it possible to not directly use
fork()?

best regards
 Waldemar

Anthony G. Basile wrote,

> On 10/27/14 16:13, bas...@opensource.dyc.edu wrote:
> >From: "Anthony G. Basile" 
> >
> >mkostemp(char *template, int flags) generates a unique temporary
> >filename from a template.  The flags parameter accepts three of
> >the same flags as open(2): O_APPEND, O_CLOEXEC, and O_SYNC.  The
> >current implementation of mkostemp(3) does not respect the flags
> >and in fact confuses the flags with the file mode which should
> >always be S_IRUSR | S_IWUSR.  This patch corrects this issue.
> 
> 
> Can someone please review this.  Thanks.
> 
> 
> >
> >Signed-off-by: Anthony G. Basile 
> >---
> >  libc/inet/getaddrinfo.c   |  2 +-
> >  libc/misc/internals/tempname.c|  6 +++---
> >  libc/misc/internals/tempname.h|  2 +-
> >  libc/stdio/tempnam.c  |  2 +-
> >  libc/stdio/tmpfile.c  |  2 +-
> >  libc/stdio/tmpnam.c   |  2 +-
> >  libc/stdio/tmpnam_r.c |  2 +-
> >  libc/stdlib/mkdtemp.c |  2 +-
> >  libc/stdlib/mkostemp.c|  4 +++-
> >  libc/stdlib/mkostemp64.c  |  2 +-
> >  libc/stdlib/mkstemp.c |  2 +-
> >  libc/stdlib/mkstemp64.c   |  2 +-
> >  libc/stdlib/mktemp.c  |  2 +-
> >  libpthread/nptl/sem_open.c|  2 +-
> >  test/.gitignore   |  2 ++
> >  test/stdlib/test-mkostemp-O_CLOEXEC.c | 40 
> > +++
> >  test/stdlib/test-mkostemp-child.c | 22 +++
> >  17 files changed, 82 insertions(+), 16 deletions(-)
> >  create mode 100644 test/stdlib/test-mkostemp-O_CLOEXEC.c
> >  create mode 100644 test/stdlib/test-mkostemp-child.c
> >
> >diff --git a/libc/inet/getaddrinfo.c b/libc/inet/getaddrinfo.c
> >index b61d69c..168adb1 100644
> >--- a/libc/inet/getaddrinfo.c
> >+++ b/libc/inet/getaddrinfo.c
> >@@ -308,7 +308,7 @@ gaih_local(const char *name, const struct gaih_service 
> >*service,
> > char *buf = ((struct sockaddr_un *)ai->ai_addr)->sun_path;
> >
> > if (__path_search(buf, L_tmpnam, NULL, NULL, 0) != 0
> >- || __gen_tempname(buf, __GT_NOCREATE, 0) != 0
> >+ || __gen_tempname(buf, __GT_NOCREATE, 0, 0) != 0
> > ) {
> > return -EAI_SYSTEM;
> > }
> >diff --git a/libc/misc/internals/tempname.c b/libc/misc/internals/tempname.c
> >index 18fd823..edcc31c 100644
> >--- a/libc/misc/internals/tempname.c
> >+++ b/libc/misc/internals/tempname.c
> >@@ -177,7 +177,7 @@ static void brain_damaged_fillrand(unsigned char *buf, 
> >unsigned int len)
> > __GT_DIR:create a directory with given mode.
> >
> >  */
> >-int attribute_hidden __gen_tempname (char *tmpl, int kind, mode_t mode)
> >+int attribute_hidden __gen_tempname (char *tmpl, int kind, int flags, 
> >mode_t mode)
> >  {
> >  char *XX;
> >  unsigned int i;
> >@@ -219,11 +219,11 @@ int attribute_hidden __gen_tempname (char *tmpl, int 
> >kind, mode_t mode)
> > fd = 0;
> > }
> > case __GT_FILE:
> >-fd = open (tmpl, O_RDWR | O_CREAT | O_EXCL, mode);
> >+fd = open (tmpl, O_RDWR | O_CREAT | O_EXCL | flags, mode);
> > break;
> >  #if defined __UCLIBC_HAS_LFS__
> > case __GT_BIGFILE:
> >-fd = open64 (tmpl, 

Re: [PATCH v2] arm: add RESET_PID in the clone impl

2014-09-11 Thread Waldemar Brodkorb
Hi Wang,

I have tested your patch for arm/armhf and NPTL. Works fine.
The getpid tests didn't fail anymore.

But when I am trying to compile linuxthreads instead of NPTL I get:
/adk/uclibc-arm-static/toolchain_qemu-arm_uclibc_arm_eabi/usr/bin/arm-openadk-linux-uclibceabi-gcc
-c libc/sysdeps/linux/arm/syscall-eabi.S -o
libc/sysdeps/linux/arm/syscall-eabi.os -Wall -Wstrict-prototypes
-Wstrict-aliasing -funsigned-char -fno-builtin -fno-asm -msoft-float
-mlittle-endian -fno-stack-protector -nostdinc -I./include
-I./include -include libc-symbols.h -I./libc/sysdeps/linux/arm
-I./libc/sysdeps/linux -I./ldso/ldso/arm -I./ldso/include -I. -Os
-funit-at-a-time -fmerge-all-constants -fstrict-aliasing
-fno-tree-loop-optimize -fno-tree-dominator-opts
-fno-strength-reduce -march=armv7-a -mtune=cortex-a9
-mfloat-abi=soft -fwrapv -fno-ident -fhonour-copts -Os -pipe -g3
-fomit-frame-pointer -fno-unwind-tables
-fno-asynchronous-unwind-tables -marm
-I./libpthread/linuxthreads/sysdeps/unix/sysv/linux/arm
-I./libpthread/linuxthreads/sysdeps/arm
-I./libpthread/linuxthreads/sysdeps/unix/sysv/linux
-I./libpthread/linuxthreads/sysdeps/pthread
-I./libpthread/linuxthreads -I./libpthread
-I./libc/sysdeps/linux/common -isystem
/adk/uclibc-arm-static/toolchain_qemu-arm_uclibc_arm_eabi/usr/lib/gcc/arm-openadk-linux-uclibceabi/4.8.3/include-fixed
-isystem
/adk/uclibc-arm-static/toolchain_qemu-arm_uclibc_arm_eabi/usr/lib/gcc/arm-openadk-linux-uclibceabi/4.8.3/include
-I/adk/uclibc-arm-static/target_qemu-arm_uclibc_arm_eabi/usr/include/
-DNDEBUG -fPIC -MT libc/sysdeps/linux/arm/syscall-eabi.os -MD -MP
-MF libc/sysdeps/linux/arm/.syscall-eabi.os.dep -D__ASSEMBLER__
-Wa,--noexecstack
./libpthread/linuxthreads/sysdeps/arm/pt-machine.h: Assembler
messages:
./libpthread/linuxthreads/sysdeps/arm/pt-machine.h:35: Error: bad
instruction `extern __inline
__attribute__((__always_inline__))__attribute__((__gnu_inline__,__artificial__))long
int'
./libpthread/linuxthreads/sysdeps/arm/pt-machine.h:36: Error: bad
instruction `testandset (int*spinlock)'
./libpthread/linuxthreads/sysdeps/arm/pt-machine.h:37: Error: junk
at end of line, first unrecognized character is `{'
./libpthread/linuxthreads/sysdeps/arm/pt-machine.h:38: Error: bad
instruction `register unsigned int movcc pc,lr'
./libpthread/linuxthreads/sysdeps/arm/pt-machine.h:40: Error: bad
instruction `__asm__ __volatile__("swp %0, %1, [%2]"'
./libpthread/linuxthreads/sysdeps/arm/pt-machine.h:41: Error: junk
at end of line, first unrecognized character is `:'
./libpthread/linuxthreads/sysdeps/arm/pt-machine.h:41: Error:
garbage following instruction -- `b __syscall_error(PLT))'
./libpthread/linuxthreads/sysdeps/arm/pt-machine.h:42: Error: junk
at end of line, first unrecognized character is `:'
./libpthread/linuxthreads/sysdeps/arm/pt-machine.h:44: Error: bad
instruction `return movcc pc,lr'
./libpthread/linuxthreads/sysdeps/arm/pt-machine.h:45: Error: junk
at end of line, first unrecognized character is `}'
./libpthread/linuxthreads/sysdeps/arm/pt-machine.h:51: Error: bad
instruction `register char*stack_pointer __asm__("sp")'
Makerules:366: recipe for target 'libc/sysdeps/linux/arm/clone.os'
failed

Any idea how to fix the bug without breaking linuxthreads?

best regards
 Waldemar
___
uClibc mailing list
uClibc@uclibc.org
http://lists.busybox.net/mailman/listinfo/uclibc


[PATCH v2] nptl: remove duplicate vfork() in libpthread

2014-09-08 Thread Waldemar Brodkorb
Automatic patching via two oneliners by Bernhard Reutner-Fischer 
:
sed -i -e 's/[[:space:]]pt-vfork\.[csS]//' -e '/^ASFLAGS-pt-vfork\./d' $(git 
grep -l pt-vfork libpthread/nptl/sysdeps)
find libpthread/nptl -name "*pt-vfork*" -exec git rm {} \;

Reported-By: Thomas Petazzoni 
Tested-by: Thomas Petazzoni 
Signed-off-by: Waldemar Brodkorb 

---
Changes in v2:
 * removed ASFLAGS suggested by Eugene Rudoy 

---
 .../nptl/sysdeps/unix/sysv/linux/alpha/pt-vfork.S  | 42 --
 .../nptl/sysdeps/unix/sysv/linux/arc/Makefile.arch |  3 +-
 .../nptl/sysdeps/unix/sysv/linux/arc/pt-vfork.S|  7 ---
 .../nptl/sysdeps/unix/sysv/linux/arm/Makefile.arch |  3 +-
 .../nptl/sysdeps/unix/sysv/linux/arm/pt-vfork.S| 37 
 .../sysdeps/unix/sysv/linux/i386/Makefile.arch |  3 +-
 .../nptl/sysdeps/unix/sysv/linux/i386/pt-vfork.S   | 67 --
 .../sysdeps/unix/sysv/linux/metag/Makefile.arch|  3 +-
 .../nptl/sysdeps/unix/sysv/linux/metag/pt-vfork.S  | 51 
 .../sysdeps/unix/sysv/linux/mips/Makefile.arch |  3 +-
 .../nptl/sysdeps/unix/sysv/linux/mips/pt-vfork.S   | 37 
 .../sysdeps/unix/sysv/linux/powerpc/Makefile.arch  |  3 +-
 .../unix/sysv/linux/powerpc/powerpc32/pt-vfork.S   | 48 
 .../unix/sysv/linux/powerpc/powerpc64/pt-vfork.S   | 48 
 .../sysdeps/unix/sysv/linux/powerpc/pt-vfork.S |  5 --
 .../nptl/sysdeps/unix/sysv/linux/sh/Makefile.arch  |  3 +-
 .../nptl/sysdeps/unix/sysv/linux/sh/pt-vfork.S | 64 -
 .../sysdeps/unix/sysv/linux/sparc/Makefile.arch|  3 +-
 .../nptl/sysdeps/unix/sysv/linux/sparc/pt-vfork.S  | 44 --
 .../sysdeps/unix/sysv/linux/x86_64/Makefile.arch   |  3 +-
 .../nptl/sysdeps/unix/sysv/linux/x86_64/pt-vfork.S | 32 ---
 21 files changed, 9 insertions(+), 500 deletions(-)
 delete mode 100644 libpthread/nptl/sysdeps/unix/sysv/linux/alpha/pt-vfork.S
 delete mode 100644 libpthread/nptl/sysdeps/unix/sysv/linux/arc/pt-vfork.S
 delete mode 100644 libpthread/nptl/sysdeps/unix/sysv/linux/arm/pt-vfork.S
 delete mode 100644 libpthread/nptl/sysdeps/unix/sysv/linux/i386/pt-vfork.S
 delete mode 100644 libpthread/nptl/sysdeps/unix/sysv/linux/metag/pt-vfork.S
 delete mode 100644 libpthread/nptl/sysdeps/unix/sysv/linux/mips/pt-vfork.S
 delete mode 100644 
libpthread/nptl/sysdeps/unix/sysv/linux/powerpc/powerpc32/pt-vfork.S
 delete mode 100644 
libpthread/nptl/sysdeps/unix/sysv/linux/powerpc/powerpc64/pt-vfork.S
 delete mode 100644 libpthread/nptl/sysdeps/unix/sysv/linux/powerpc/pt-vfork.S
 delete mode 100644 libpthread/nptl/sysdeps/unix/sysv/linux/sh/pt-vfork.S
 delete mode 100644 libpthread/nptl/sysdeps/unix/sysv/linux/sparc/pt-vfork.S
 delete mode 100644 libpthread/nptl/sysdeps/unix/sysv/linux/x86_64/pt-vfork.S

diff --git a/libpthread/nptl/sysdeps/unix/sysv/linux/alpha/pt-vfork.S 
b/libpthread/nptl/sysdeps/unix/sysv/linux/alpha/pt-vfork.S
deleted file mode 100644
index a6005c1..000
--- a/libpthread/nptl/sysdeps/unix/sysv/linux/alpha/pt-vfork.S
+++ /dev/null
@@ -1,42 +0,0 @@
-/* Copyright (C) 2003, 2004 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
-   modify it under the terms of the GNU Lesser General Public
-   License as published by the Free Software Foundation; either
-   version 2.1 of the License, or (at your option) any later version.
-
-   The GNU C Library is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Lesser General Public License for more details.
-
-   You should have received a copy of the GNU Lesser General Public
-   License along with the GNU C Library; if not, see
-   <http://www.gnu.org/licenses/>.  */
-
-#include 
-#include 
-
-#undef PSEUDO_PREPARE_ARGS
-#define PSEUDO_PREPARE_ARGS\
-   /* Load the current cached pid value across the vfork.  */  \
-   rduniq; \
-   ldl a2, PID_OFFSET(v0); \
-   mov v0, a1; \
-   /* Write back its negation, to indicate that the pid value is   \
-  uninitialized in the the child, and in the window between\
-  here and the point at which we restore the value.  */\
-   negla2, t0; \
-   stl t0, PID_OFFSET(v0);
-
-PSEUDO (__vfork, vfork, 0)
-
-   /* If we're back in the parent, restore the saved pid.  */
-   beq v0, 1f
-   stl a2, PID_OFFSET(a1)
-1: ret
-
-PSEUDO_END (__vfork)
-
-weak_alias (__vfork, vfork)
diff --git a/libpthread/nptl/sysdeps/unix/sysv/linux/arc/Makefile.arch 
b/libpthread/nptl/

Re: [PATCH] nptl: remove duplicate vfork() in libpthread

2014-09-08 Thread Waldemar Brodkorb
Hi Eugene,
Eugene Rudoy wrote,

> Hi Waldemar,
> 
> On Fri, Sep 5, 2014 at 4:13 PM, Waldemar Brodkorb  wrote:
> 
> Automatic patching via two oneliners from Bernhard Reutner-Fischer <
> rep.dot@gmail.com>:
> sed -i -e 's/[[:space:]]pt-vfork\.[csS]//' $(git grep -l pt-vfork
> libpthread/nptl/sysdeps)
> find libpthread/nptl -name "*pt-vfork*" -exec git rm {} \;
> 
> 
> not sure if this really matters... just wanted to point out that libc- and
> libpthread-versions of vfork are not exactly identical - on some archs it's
> just a different definition of SAVE_PID/RESTORE_PID, on some archs a littile
> bit more:
> for d in $(find libpthread/nptl -name "pt-vfork.S" -printf "%h\n"); do diff -u
> $d/pt-vfork.S $d/vfork.S; done

Yeah, we know there is a difference, but glibc removed the
micro optimized versions of vfork for NPTL and so we should do, to
avoid static linking problems.
 
> If this doesn't matter and the pt-vfork versions should all really be deleted
> then the 1st of your oneliners should be extended a bit (Makefiles still
> contain the no more necessary ASFLAGS-pt-vfork entries):
> sed -i -e 's/[[:space:]]pt-vfork\.[csS]//' -e '/^ASFLAGS-pt-vfork\./ d' $(git
> grep -l pt-vfork libpthread/nptl/sysdeps)

The oneline was from Bernhard ;)
But you are right, the empty stuff should be removed.

best regards
 Waldemar
___
uClibc mailing list
uClibc@uclibc.org
http://lists.busybox.net/mailman/listinfo/uclibc


Re: ARC testsuite compile problem

2014-09-08 Thread Waldemar Brodkorb
Hi Alexey,
Alexey Brodkin wrote,

> Hi Waldemar,
> 
> On Sat, 2014-09-06 at 12:19 +0200, Waldemar Brodkorb wrote:
> > Hi uClibc hackers,
> > 
> > I try to compile the test suite for ARC with NPTL/TLS enabled.
> > I get following error:
> > /home/vmadmin/embedded-test/openadk/toolchain_toolchain-arc_uclibc_arc/usr/bin/arc-openadk-linux-uclibc-gcc
> > -Wl,-EL -funsigned-char -fno-builtin -fno-asm -msoft-float
> > -std=gnu99 -mlock -mswape -mA7 -marclinux -Wl,-z,now -Wl,-s
> > -Wl,-rpath,/home/vmadmin/embedded-test/openadk/toolchain_build_toolchain-arc_uclibc_arc/w-uClibc-0.9.34-git-1/uClibc-0.9.34-git/test/tls
> > -Wl,--dynamic-linker,/lib//ld-uClibc.so.0 tst-tls-at-ctor.o -o
> > tst-tls-at-ctor  tst-tlsmod-at-ctor.so
> > collect2: error: ld terminated with signal 11 [Segmentation fault]
> > 
> > dmesg shows:
> > [9295686.305104] ld[20207]: segfault at 68 ip 0045e676 sp
> > 7173aa30 error 4 in
> > arc-openadk-linux-uclibc-ld.bfd[40+111000]
> > 
> > Any idea what is going wrong here?
> 
> Unfortunately this is a known issue with ARC toolchain.
> For now I may only propose to disable this test for ARC while toolchain
> is not fixed.
> 
> BTW "tst-tls12" also causes the same problem.

Okay, good to know that it is a known bug.
 
> Please let me know if you want me to send a patch that disables
> mentioned tests for ARC.

No, just inform us, when the bug is fixed. I can add a local patch
for my test builds.
 
> I'll try to get a response from our binutils people and hopefully patch
> that fixes a root cause in binutils will be available soon.
 
Cool, thanks!
 Waldemar
___
uClibc mailing list
uClibc@uclibc.org
http://lists.busybox.net/mailman/listinfo/uclibc


problem with LT and static build

2014-09-08 Thread Waldemar Brodkorb
Hi uClibc hackers,

I am trying to build a static system with linuxthreads (new).
But I get following linking errors (for test-suite or any apps)

/usr/bin/make -C  termios compile \

KCONFIG_CONFIG=/adk/uclibc-arm-static/toolchain_build_qemu-arm_uclibc_arm_eabi/w-uClibc-0.9.34-git-1/uClibc-0.9.34-git/.config
/adk/uclibc-arm-static/toolchain_qemu-arm_uclibc_arm_eabi/usr/bin/arm-openadk-linux-uclibceabi-gcc
-nostdinc -I../../install_dir/usr/include -I../../test -D_GNU_SOURCE
-I/adk/uclibc-arm-static/target_qemu-arm_uclibc_arm_eabi/usr/include/
-isystem
/adk/uclibc-arm-static/toolchain_qemu-arm_uclibc_arm_eabi/usr/lib/gcc/arm-openadk-linux-uclibceabi/4.8.3/include-fixed
-isystem
/adk/uclibc-arm-static/toolchain_qemu-arm_uclibc_arm_eabi/usr/lib/gcc/arm-openadk-linux-uclibceabi/4.8.3/include
-Os -funit-at-a-time -fmerge-all-constants -fstrict-aliasing
-fno-tree-loop-optimize -fno-tree-dominator-opts
-fno-strength-reduce -funsigned-char -fno-builtin -fno-asm
-msoft-float -std=gnu99 -mlittle-endian -Wall -Wstrict-prototypes
-Wstrict-aliasing -Wstrict-prototypes-c termios.c -o termios.o
/adk/uclibc-arm-static/toolchain_qemu-arm_uclibc_arm_eabi/usr/bin/arm-openadk-linux-uclibceabi-gcc
-Wl,-EL -Wl,-z,now -Wl,-s -Wl,-static -static-libgcc
-Wl,-rpath,/adk/uclibc-arm-static/toolchain_build_qemu-arm_uclibc_arm_eabi/w-uClibc-0.9.34-git-1/uClibc-0.9.34-git/test/termios
termios.o -o termios  
/adk/uclibc-arm-static/toolchain_qemu-arm_uclibc_arm_eabi/usr/../../target_qemu-arm_uclibc_arm_eabi/usr/lib/libc.a(ioctl.os):
In function `__GI_ioctl':
/adk/uclibc-arm-static/toolchain_build_qemu-arm_uclibc_arm_eabi/w-uClibc-0.9.34-git-1/uClibc-0.9.34-git/libc/sysdeps/linux/common/ioctl.c:31:
undefined reference to `__libc_enable_asynccancel'
/adk/uclibc-arm-static/toolchain_build_qemu-arm_uclibc_arm_eabi/w-uClibc-0.9.34-git-1/uClibc-0.9.34-git/libc/sysdeps/linux/common/ioctl.c:33:
undefined reference to `__libc_disable_asynccancel'
/adk/uclibc-arm-static/toolchain_qemu-arm_uclibc_arm_eabi/usr/../../target_qemu-arm_uclibc_arm_eabi/usr/lib/libc.a(close.os):
In function `__GI_close':
/adk/uclibc-arm-static/toolchain_build_qemu-arm_uclibc_arm_eabi/w-uClibc-0.9.34-git-1/uClibc-0.9.34-git/libc/sysdeps/linux/common/close.c:20:
undefined reference to `__libc_enable_asynccancel'
/adk/uclibc-arm-static/toolchain_build_qemu-arm_uclibc_arm_eabi/w-uClibc-0.9.34-git-1/uClibc-0.9.34-git/libc/sysdeps/linux/common/close.c:20:
undefined reference to `__libc_disable_asynccancel'
...

The __libc_enable_asynccancel and __libc_disable_asynccancel is
indeed missing in libc.a. (extracted the ar archiv and looked into
object files via nm)

What's wrong here? I need linuxthreads(new) for m68k and gdbserver.
Newer gdb does require threads and is using some TLS stuff, which is
only implemented in linuxthreads(new).

Before trying to get it working for m68k, I like to get it working
for arm (more popular, better support). The shared version compiles
fine, but I need the static one.

best regards
 Waldemar

___
uClibc mailing list
uClibc@uclibc.org
http://lists.busybox.net/mailman/listinfo/uclibc


ARC testsuite compile problem

2014-09-06 Thread Waldemar Brodkorb
Hi uClibc hackers,

I try to compile the test suite for ARC with NPTL/TLS enabled.
I get following error:
/home/vmadmin/embedded-test/openadk/toolchain_toolchain-arc_uclibc_arc/usr/bin/arc-openadk-linux-uclibc-gcc
-Wl,-EL -funsigned-char -fno-builtin -fno-asm -msoft-float
-std=gnu99 -mlock -mswape -mA7 -marclinux -Wl,-z,now -Wl,-s
-Wl,-rpath,/home/vmadmin/embedded-test/openadk/toolchain_build_toolchain-arc_uclibc_arc/w-uClibc-0.9.34-git-1/uClibc-0.9.34-git/test/tls
-Wl,--dynamic-linker,/lib//ld-uClibc.so.0 tst-tls-at-ctor.o -o
tst-tls-at-ctor  tst-tlsmod-at-ctor.so
collect2: error: ld terminated with signal 11 [Segmentation fault]

dmesg shows:
[9295686.305104] ld[20207]: segfault at 68 ip 0045e676 sp
7173aa30 error 4 in
arc-openadk-linux-uclibc-ld.bfd[40+111000]

Any idea what is going wrong here?

Use config is here:
http://www.openadk.org/cgi-bin/gitweb.cgi?p=openadk.git;a=blob;f=target/arc/uclibc.config;h=8f9dddb4dfea9672f62b963f5121e2e1b07c27e1;hb=refs/heads/master

(LITTLE_ENDIAN is activated via sed...)

gcc is from here:
https://github.com/foss-for-synopsys-dwc-arc-processors/gcc/tree/arc-4.8-tls
e9dbcfdba0f42639b3aa9e3b06fe781599eb98fe
binutils from here:
https://github.com/foss-for-synopsys-dwc-arc-processors/binutils-gdb/tree/arc-2.23-tls
afcd0783a37c73e09439737a11e0b3183746a652

Any ideas?

best regards
 Waldemar

___
uClibc mailing list
uClibc@uclibc.org
http://lists.busybox.net/mailman/listinfo/uclibc


Re: m68k test-suite linking error

2014-09-05 Thread Waldemar Brodkorb
Hi Bernhard,
Bernhard Reutner-Fischer wrote,

> On 4 September 2014 23:06, Bernhard Reutner-Fischer
>  wrote:
> > On 4 September 2014 20:47, Waldemar Brodkorb  wrote:
> >> Hi,
> >>
> >> I am trying to compile uClibc master from today for m68k targeting
> >> Aranym-mmu. The C library compiles, but the test-suite fails.
> >
> >> /home/vmadmin/openadk/toolchain_aranym-m68k_uclibc_m68k/usr/lib/gcc/m68k-openadk-linux-uclibc/4.8.3/../../../../m68k-openadk-linux-uclibc/bin/ld:
> >> BFD (GNU Binutils) 2.24 assertion fail elf32-m68k.c:2641
> >> collect2: error: ld returned 1 exit status
> >>
> >> Is this commit related?
> >> http://git.uclibc.org/uClibc/commit/?id=7a3acb243bc09f253a77faee7ee097a781f3eebe
> >
> > No, not directly related.
> >>
> >> It didn't work before, but may someone (Bernhard?) have an idea?
> 
> FWIW, It can't find the GOT, I assume it's time to tweak our m68k ld..

May be I can give you some up to date information what is working
for me on m68k architecture and what is not.

There are two simulators available one for classic m68k and one for
coldfire.
Aranym-mmu works for classic m68k.
Qemu-system-m68k works for coldfire mcf5208evb (5208 CPU)
The Arnewsh 5206 Qemu-system-m68k emulation have no network card
support. There is Qemu Fork for classic m68k emulation, but last
time I tried, I didn't get it working.

You can build a cross-toolchain with gcc 4.8.3 and binutils 2.24.
For binutils no patches are required. For gcc I added two
modifications to avoid building libatomics:
http://www.openadk.org/cgi-bin/gitweb.cgi?p=openadk.git;a=blob;f=toolchain/gcc/patches/4.8.3/disable-atomics.m68k;h=4ab5532188cb59f7e5ae03aeabcc4a91c954d804;hb=HEAD
And to avoid breaking compile with -msep-data:
http://www.openadk.org/cgi-bin/gitweb.cgi?p=openadk.git;a=blob;f=toolchain/gcc/patches/4.8.3/disable-tm.m68k;h=02b5cb854e0e6a2ef20798096fda7aabe4cf857f;hb=HEAD

See bugreports:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=54584
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=53833

To complete your toolchain to build BFLTv4 binaries with your
toolchain, you need to get a copy of elf2flt. (cvs.uclinux.org is
dead and will eventually come back)
I use following to setup the symlinks right:
http://www.openadk.org/cgi-bin/gitweb.cgi?p=openadk.git;a=blob;f=toolchain/elf2flt/Makefile;h=a42398a3e364fd7e5968730fc01b9a278ee23c57;hb=HEAD

You shouldn't need all of the above for a classic m68k toolchain to
build an image, which works with Aranym-mmu. (gcc 4.9.1 works, too)

For Qemu you need a patch:
http://www.openadk.org/coldfire/qemu-2.1.0-m68k.patch

To boot Linux you need two patches:
One two get Linux to bootup from Thomas Petazzoni:
http://www.openadk.org/cgi-bin/gitweb.cgi?p=openadk.git;a=blob;f=target/m68k/qemu-m68k/patches/3.16.1/qemu-coldfire.patch;h=503fe8ef3ec70952856c84f85ca5e6d88440b104;hb=HEAD
And one if you want to bootup when you try to use ethernet from Greg
Ungerer:
http://www.openadk.org/cgi-bin/gitweb.cgi?p=openadk.git;a=blob;f=target/m68k/qemu-m68k/patches/3.16.1/m68k-coldfire-fec.patch;h=60dfadb6d2223336e12bf12042abe1349bfeebc5;hb=HEAD

This thread on the uClinux mailinglist might be interesting:
http://mailman.uclinux.org/pipermail/uclinux-dev/2014-August/052557.html

For simple userland I use simpleinit/sash from uClinux project.
http://sourceforge.net/projects/uclinux/files/uClinux%20Stable/dist-20140504/uClinux-dist-20140504.tar.bz2/download

With busybox and hush I have a unresolved issue regarding the signal
handling in uClibc (0.9.33.2/master are both problematic)
See following thread for details:
http://lists.busybox.net/pipermail/busybox/2014-August/081619.html
And a simple testcase, which fails:
http://lists.busybox.net/pipermail/busybox/2014-September/081659.html

There are at least two other open problems, to get the signal
handler problem solved:
- get a working gdbserver/gdb combo for coldfire
  gdbserver fails to compile. (7.8)
- ethernet in qemu does not work, fec driver does not find a
  ethernet nic

To get more output from userland programs, use flthdr -k to enable
kernel information. There is always a program.gdb file, which is
useful to inspect via readelf.

The test suite compiles for coldfire, but not for m68k classic.
I sue following configs for uClibc:
http://www.openadk.org/cgi-bin/gitweb.cgi?p=openadk.git;a=blob;f=target/m68k/uclibc-nommu.config;h=e7017d38e93e6c6ea1427ce01bc0771be3022e5e;hb=HEAD
http://www.openadk.org/cgi-bin/gitweb.cgi?p=openadk.git;a=blob;f=target/m68k/uclibc.config;h=27b9e692310c2c05c72a2509662316415dae5ae5;hb=HEAD

And following miniconfigs for the kernel:
http://www.openadk.org/cgi-bin/gitweb.cgi?p=openadk.git;a=blob;f=target/m68k/kernel/aranym-m68k;h=ac513fdc6e2c6c72609577a680e4ad648ed30b18;hb=HEAD
http://www.openadk.org/cgi-bin/gitweb.cgi?p=openadk.git;a=blob;f=target/m68k/kernel/q

[PATCH] nptl: remove duplicate vfork() in libpthread

2014-09-05 Thread Waldemar Brodkorb
Automatic patching via two oneliners from Bernhard Reutner-Fischer 
:
sed -i -e 's/[[:space:]]pt-vfork\.[csS]//' $(git grep -l pt-vfork 
libpthread/nptl/sysdeps)
find libpthread/nptl -name "*pt-vfork*" -exec git rm {} \;

No regressions found via testsuite run:
http://www.openadk.org/test/

If you want to run the automatic testing:
wget 
http://www.openadk.org/cgi-bin/gitweb.cgi?p=embedded-test.git;a=blob_plain;f=embedded-test.sh;hb=HEAD
sh embedded-test.sh -v openadk -l uclibc -g -t libc

Reported-By: Thomas Petazzoni 
Signed-off-by: Waldemar Brodkorb 
---
 .../nptl/sysdeps/unix/sysv/linux/alpha/pt-vfork.S  | 42 --
 .../nptl/sysdeps/unix/sysv/linux/arc/Makefile.arch |  2 +-
 .../nptl/sysdeps/unix/sysv/linux/arc/pt-vfork.S|  7 ---
 .../nptl/sysdeps/unix/sysv/linux/arm/Makefile.arch |  2 +-
 .../nptl/sysdeps/unix/sysv/linux/arm/pt-vfork.S| 37 
 .../sysdeps/unix/sysv/linux/i386/Makefile.arch |  2 +-
 .../nptl/sysdeps/unix/sysv/linux/i386/pt-vfork.S   | 67 --
 .../sysdeps/unix/sysv/linux/metag/Makefile.arch|  2 +-
 .../nptl/sysdeps/unix/sysv/linux/metag/pt-vfork.S  | 51 
 .../sysdeps/unix/sysv/linux/mips/Makefile.arch |  2 +-
 .../nptl/sysdeps/unix/sysv/linux/mips/pt-vfork.S   | 37 
 .../sysdeps/unix/sysv/linux/powerpc/Makefile.arch  |  2 +-
 .../unix/sysv/linux/powerpc/powerpc32/pt-vfork.S   | 48 
 .../unix/sysv/linux/powerpc/powerpc64/pt-vfork.S   | 48 
 .../sysdeps/unix/sysv/linux/powerpc/pt-vfork.S |  5 --
 .../nptl/sysdeps/unix/sysv/linux/sh/Makefile.arch  |  2 +-
 .../nptl/sysdeps/unix/sysv/linux/sh/pt-vfork.S | 64 -
 .../sysdeps/unix/sysv/linux/sparc/Makefile.arch|  2 +-
 .../nptl/sysdeps/unix/sysv/linux/sparc/pt-vfork.S  | 44 --
 .../sysdeps/unix/sysv/linux/x86_64/Makefile.arch   |  2 +-
 .../nptl/sysdeps/unix/sysv/linux/x86_64/pt-vfork.S | 32 ---
 21 files changed, 9 insertions(+), 491 deletions(-)
 delete mode 100644 libpthread/nptl/sysdeps/unix/sysv/linux/alpha/pt-vfork.S
 delete mode 100644 libpthread/nptl/sysdeps/unix/sysv/linux/arc/pt-vfork.S
 delete mode 100644 libpthread/nptl/sysdeps/unix/sysv/linux/arm/pt-vfork.S
 delete mode 100644 libpthread/nptl/sysdeps/unix/sysv/linux/i386/pt-vfork.S
 delete mode 100644 libpthread/nptl/sysdeps/unix/sysv/linux/metag/pt-vfork.S
 delete mode 100644 libpthread/nptl/sysdeps/unix/sysv/linux/mips/pt-vfork.S
 delete mode 100644 
libpthread/nptl/sysdeps/unix/sysv/linux/powerpc/powerpc32/pt-vfork.S
 delete mode 100644 
libpthread/nptl/sysdeps/unix/sysv/linux/powerpc/powerpc64/pt-vfork.S
 delete mode 100644 libpthread/nptl/sysdeps/unix/sysv/linux/powerpc/pt-vfork.S
 delete mode 100644 libpthread/nptl/sysdeps/unix/sysv/linux/sh/pt-vfork.S
 delete mode 100644 libpthread/nptl/sysdeps/unix/sysv/linux/sparc/pt-vfork.S
 delete mode 100644 libpthread/nptl/sysdeps/unix/sysv/linux/x86_64/pt-vfork.S

diff --git a/libpthread/nptl/sysdeps/unix/sysv/linux/alpha/pt-vfork.S 
b/libpthread/nptl/sysdeps/unix/sysv/linux/alpha/pt-vfork.S
deleted file mode 100644
index a6005c1..000
--- a/libpthread/nptl/sysdeps/unix/sysv/linux/alpha/pt-vfork.S
+++ /dev/null
@@ -1,42 +0,0 @@
-/* Copyright (C) 2003, 2004 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
-   modify it under the terms of the GNU Lesser General Public
-   License as published by the Free Software Foundation; either
-   version 2.1 of the License, or (at your option) any later version.
-
-   The GNU C Library is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Lesser General Public License for more details.
-
-   You should have received a copy of the GNU Lesser General Public
-   License along with the GNU C Library; if not, see
-   <http://www.gnu.org/licenses/>.  */
-
-#include 
-#include 
-
-#undef PSEUDO_PREPARE_ARGS
-#define PSEUDO_PREPARE_ARGS\
-   /* Load the current cached pid value across the vfork.  */  \
-   rduniq; \
-   ldl a2, PID_OFFSET(v0); \
-   mov v0, a1; \
-   /* Write back its negation, to indicate that the pid value is   \
-  uninitialized in the the child, and in the window between\
-  here and the point at which we restore the value.  */\
-   negla2, t0; \
-   stl t0, PID_OFFSET(v0);
-
-PSEUDO (__vfork, vfork, 0)
-
-   /* If we're back in the parent, restore the saved pid.  */
-   beq v0, 1f
-   stl a2, PID_OFFSET(a1)
-1: ret
-
-PSE

m68k test-suite linking error

2014-09-04 Thread Waldemar Brodkorb
Hi,

I am trying to compile uClibc master from today for m68k targeting
Aranym-mmu. The C library compiles, but the test-suite fails.

KCONFIG_CONFIG=/home/vmadmin/openadk/toolchain_build_aranym-m68k_uclibc_m68k/w-uClibc-0.9.34-git-1/uClibc-0.9.34-git/.config
/home/vmadmin/openadk/toolchain_aranym-m68k_uclibc_m68k/usr/bin/m68k-openadk-linux-uclibc-gcc
-nostdinc -I../../install_dir/usr/include -I../../test -D_GNU_SOURCE
-I/home/vmadmin/openadk/target_aranym-m68k_uclibc_m68k/usr/include/
-isystem
/home/vmadmin/openadk/toolchain_aranym-m68k_uclibc_m68k/usr/lib/gcc/m68k-openadk-linux-uclibc/4.8.3/include-fixed
-isystem
/home/vmadmin/openadk/toolchain_aranym-m68k_uclibc_m68k/usr/lib/gcc/m68k-openadk-linux-uclibc/4.8.3/include
-Os -funit-at-a-time -fmerge-all-constants -fstrict-aliasing
-fno-tree-loop-optimize -fno-tree-dominator-opts
-fno-strength-reduce -fwrapv -fno-ident -fhonour-copts -Os -pipe -g3
-fomit-frame-pointer -fno-unwind-tables
-fno-asynchronous-unwind-tables -Wall -Wstrict-prototypes
-Wstrict-aliasing -Wstrict-prototypes-c assert.c -o assert.o
/home/vmadmin/openadk/toolchain_aranym-m68k_uclibc_m68k/usr/bin/m68k-openadk-linux-uclibc-gcc
-Wl,-EB -Wl,-z,now -Wl,-s
-Wl,-rpath,/home/vmadmin/openadk/toolchain_build_aranym-m68k_uclibc_m68k/w-uClibc-0.9.34-git-1/uClibc-0.9.34-git/test/assert
-Wl,--dynamic-linker,/lib//ld-uClibc.so.0 assert.o -o assert  
/home/vmadmin/openadk/toolchain_aranym-m68k_uclibc_m68k/usr/lib/gcc/m68k-openadk-linux-uclibc/4.8.3/../../../../m68k-openadk-linux-uclibc/bin/ld:
BFD (GNU Binutils) 2.24 assertion fail elf32-m68k.c:2641
collect2: error: ld returned 1 exit status

Is this commit related?
http://git.uclibc.org/uClibc/commit/?id=7a3acb243bc09f253a77faee7ee097a781f3eebe

It didn't work before, but may someone (Bernhard?) have an idea?

best regards
 Waldemar

___
uClibc mailing list
uClibc@uclibc.org
http://lists.busybox.net/mailman/listinfo/uclibc


Re: [PATCH] arm: add RESET_PID in the clone impl

2014-09-03 Thread Waldemar Brodkorb
Hi Carmelo,
Carmelo Amoroso wrote,

> Hi,
> I don't think clone on arm is missing RESET_PID if you use the
> correct implementation from
> libpthread/nptl/sysdeps/unix/sysv/linux/arm/clone.S.

Can you explain this a little bit more?

cat ./libpthread/nptl/sysdeps/unix/sysv/linux/arm/clone.S
#define RESET_PID
#include 
#include "../../../../../../../libc/sysdeps/linux/arm/clone.S"

Do you think the test-suite failures on arm come from a buildsystem
problem?

best regards
 Waldemar
 
> Cheers
> Carmelo
> 
> Inviato con AquaMail per Android
> http://www.aqua-mail.com
> 
> 
> Il 02 settembre 2014 14:12:24 Wangyufen  ha scritto:
> 
> >From: Wang Yufen 
> >
> >Called getpid() When creating a new process with clone(), getpid() returns
> >the father_process's value. It should be child_process's value.
> >The reason is missing a RESET_PID in the arm clone impl.
> >
> >Signed-off-by: Wang Yufen 
> >---
> > libc/sysdeps/linux/arm/clone.S  |   61 
> > ++-
> > libc/sysdeps/linux/arm/sysdep.h |   45 
> > 2 files changed, 92 insertions(+), 14 deletions(-)
> >
> >diff --git a/libc/sysdeps/linux/arm/clone.S b/libc/sysdeps/linux/arm/clone.S
> >index 03cd10e..29045ef 100644
> >--- a/libc/sysdeps/linux/arm/clone.S
> >+++ b/libc/sysdeps/linux/arm/clone.S
> >@@ -19,12 +19,17 @@
> > /* clone() is even more special than fork() as it mucks with stacks
> >and invokes a function in the right context after its all over.  */
> >
> >+#include 
> > #define _ERRNO_H
> > #include 
> > #include 
> > #include 
> > #include 
> > #include 
> >+#include 
> >+
> >+#define CLONE_VM  0x0100
> >+#define CLONE_THREAD  0x0001
> >
> > #if defined(__NR_clone)
> > /* int clone(int (*fn)(void *arg), void *child_stack, int flags, void 
> > *arg); */
> >@@ -87,6 +92,8 @@ __error:
> > .pool
> > #else
> > __clone:
> >+.fnstart
> >+.cantunwind
> > @ sanity check args
> > cmp r0, #0
> > IT(te, ne)
> >@@ -95,32 +102,58 @@ __clone:
> > beq __error
> >
> > @ insert the args onto the new stack
> >-sub r1, r1, #8
> >-str r3, [r1, #4]
> >-@ save the function pointer as the 0th element
> >-str r0, [r1]
> >+str r3, [r1, #-4]!
> >+str r0, [r1, #-4]!
> >
> > @ do the system call
> > @ get flags
> > mov r0, r2
> >+#ifdef RESET_PID
> >+mov ip, r2
> >+#endif
> > @ new sp is already in r1
> >-@ load remaining arguments off the stack
> >-stmfd   sp!, {r4}
> >-ldr r2, [sp, #4]
> >-ldr r3, [sp, #8]
> >-ldr r4, [sp, #12]
> >-DO_CALL (clone)
> >-movsa1, a1
> >-IT(t, ne)
> >-ldmnefd sp!, {r4}
> >+push{r4, r7}
> >+cfi_adjust_cfa_offset (8)
> >+cfi_rel_offset (r4, 0)
> >+cfi_rel_offset (r7, 4)
> >+ldr r2, [sp, #8]
> >+ldr r3, [sp, #12]
> >+ldr r4, [sp, #16]
> >+ldr r7, =SYS_ify(clone)
> >+swi 0x0
> >+cfi_endproc
> >+cmp r0, #0
> >+beq 1f
> >+pop {r4, r7}
> > blt __error
> >-IT(t, ne)
> > #if defined(__USE_BX__)
> > bxnelr
> > #else
> > movne   pc, lr
> > #endif
> >
> >+cfi_startproc
> >+.fnend
> >+PSEUDO_END (__clone)
> >+
> >+1:
> >+.fnstart
> >+.cantunwind
> >+#ifdef RESET_PID
> >+tst ip, #CLONE_THREAD
> >+bne 3f
> >+GET_TLS (lr)
> >+mov r1, r0
> >+tst ip, #CLONE_VM
> >+ldr r7, =SYS_ify(getpid)
> >+ite ne
> >+movne   r0, #-1
> >+swieq   0x0
> >+NEGOFF_ADJ_BASE (r1, TID_OFFSET)
> >+str r0, NEGOFF_OFF1 (r1, TID_OFFSET)
> >+str r0, NEGOFF_OFF2 (r1, PID_OFFSET, TID_OFFSET)
> >+3:
> >+#endif
> > @ pick the function arg and call address off the stack and execute
> > ldr r0, [sp, #4]
> > mov lr, pc
> >diff --git a/libc/sysdeps/linux/arm/sysdep.h 
> >b/libc/sysdeps/linux/arm/sysdep.h
> >index 64f4040..38a131d 100644
> >--- a/libc/sysdeps/linux/arm/sysdep.h
> >+++ b/libc/sysdeps/linux/arm/sysdep.h
> >@@ -213,6 +213,51 @@ __local_syscall_error:  
> >\
> >sees the right arguments.
> >
> > */
> >+#if __ARM_ARCH > 4 || defined (__ARM_ARCH_4T__)
> >+# define ARCH_HAS_BX
> >+#endif
> >+#if __ARM_ARCH > 4
> >+# define ARCH_HAS_BLX
> >+#endif
> >+#if __ARM_ARCH > 6 || defined (__ARM_ARCH_6K__) || defined 
> >(__ARM_ARCH_6ZK__)
> >+# define ARCH_HAS_HARD_TP
> >+#endif
> >+#if __ARM_ARCH > 6 || defined (__ARM_ARCH_6T2__)
> >+# define ARCH_HAS_T2
> >+#endif
> >+
> >+# ifdef __thumb2__
> >+#  define NEGOFF_ADJ_BASE(R, OFF)   add R, R, $OFF
> >+#  define NEGOFF_ADJ_BASE2(D, S, OFF)   add D, S, $OFF
> >+#  define NEGOFF_OFF1(R, OFF)   [R]
> >+#  define NEGOFF_OFF2(R, OFFA, OFFB)[R, $((OFFA) - (OFFB))]
> >+# else
> >+#  define NEGOFF_ADJ_BASE(R, OFF)
> >+#  define NEGOFF_ADJ_BASE2(D, S, OFF)   mov D, S
> >+#  define NEGOFF_OFF1(R, OFF)   [R, $OFF]
> >+#  define NEGOFF_OFF2

Re: sparc64 removal patch too big

2014-09-03 Thread Waldemar Brodkorb
Hi Baruch,
Baruch Siach wrote,

> Hi Waldemar,
> 
> On Tue, Sep 02, 2014 at 04:05:37PM +0200, Waldemar Brodkorb wrote:
> > Anyone Admin for the mailinglist?
> > My sparc64 removal patch was set on hold.
> 
> You may try the -D parameter of git format-patch. It omits the text of 
> deleted 
> files, thus making the patch much smaller and also easier to review.

This worked, thanks for the hint.
best regards
 Waldemar
 
___
uClibc mailing list
uClibc@uclibc.org
http://lists.busybox.net/mailman/listinfo/uclibc


[PATCH] sparc: remove sparc64/sparcv9 code

2014-09-03 Thread Waldemar Brodkorb
The sparc64/sparcv9 code is incomplete. Furthermore there is
no real embedded hardware for sparc64 available, so better remove
it until someone comes up with a complete port.

Signed-off-by: Waldemar Brodkorb 
---

Test before patch: http://www.openadk.org/test/REPORT.sparc.uclibc
Test after patch: http://www.openadk.org/test/REPORT.sparc.uclibc.libc
No regression found.
Changes to libc/string/sparc/ are incomplete. What would the best way
to change libc/string/sparc/memchr.S and others?

---
 extra/Configs/Config.sparc |   6 -
 libc/string/sparc/sparc64/memchr.S | 258 --
 libc/string/sparc/sparc64/memcpy.S | 922 -
 libc/string/sparc/sparc64/memset.S | 316 ---
 libc/string/sparc/sparc64/sparcv9b/memcpy.S| 611 --
 libc/string/sparc/sparc64/stpcpy.S | 270 --
 libc/string/sparc/sparc64/strcat.S | 338 
 libc/string/sparc/sparc64/strchr.S | 485 ---
 libc/string/sparc/sparc64/strcmp.S | 278 ---
 libc/string/sparc/sparc64/strcpy.S | 244 --
 libc/string/sparc/sparc64/strlen.S | 172 
 libc/sysdeps/linux/sparc/bits/setjmp.h |  31 -
 libc/sysdeps/linux/sparc/bits/sigcontext.h |  35 -
 libc/sysdeps/linux/sparc/crt1.S|  11 -
 libc/sysdeps/linux/sparc/jmpbuf-unwind.h   |  25 +-
 libc/sysdeps/linux/sparc/qp_ops.c  |   8 -
 libc/sysdeps/linux/sparc/sparcv9/clone.S   | 101 ---
 libc/sysdeps/linux/sparc/sparcv9/rem.S |  20 -
 libc/sysdeps/linux/sparc/sparcv9/sdiv.S|  18 -
 libc/sysdeps/linux/sparc/sparcv9/udiv.S|  15 -
 libc/sysdeps/linux/sparc/sparcv9/umul.S|  15 -
 libc/sysdeps/linux/sparc/sparcv9/urem.S|  17 -
 libc/sysdeps/linux/sparc/sys/procfs.h  |  88 --
 .../linuxthreads.old/sysdeps/sparc/pt-machine.h|  86 +-
 .../sysdeps/sparc/sparc32/pt-machine.h |  82 --
 .../sysdeps/sparc/sparc64/pt-machine.h | 104 ---
 libpthread/linuxthreads/sysdeps/sparc/pspinlock.c  |  95 ++-
 libpthread/linuxthreads/sysdeps/sparc/pt-machine.h |  86 +-
 .../linuxthreads/sysdeps/sparc/sparc32/pspinlock.c |  87 --
 .../sysdeps/sparc/sparc32/pt-machine.h |  82 --
 .../sysdeps/sparc/sparc32/sparcv9/pspinlock.c  |  93 ---
 .../linuxthreads/sysdeps/sparc/sparc64/pspinlock.c |  92 --
 .../sysdeps/sparc/sparc64/pt-machine.h | 104 ---
 .../unix/sysv/linux/sparc/sparc32/sysdep-cancel.h  | 100 ---
 .../sysdeps/unix/sysv/linux/sparc/sparc32/vfork.S  |  64 --
 .../unix/sysv/linux/sparc/sparc64/pt-sigsuspend.c  |   1 -
 .../unix/sysv/linux/sparc/sparc64/sysdep-cancel.h  |  99 ---
 .../sysdeps/unix/sysv/linux/sparc/sparc64/vfork.S  |  63 --
 .../sysdeps/unix/sysv/linux/sparc/sysdep-cancel.h  | 102 ++-
 .../sysdeps/unix/sysv/linux/sparc/vfork.S  |  64 ++
 libpthread/nptl/sysdeps/jmpbuf-unwind.h|  27 +
 libpthread/nptl/sysdeps/pthread_spin_lock.c|  39 +
 libpthread/nptl/sysdeps/pthread_spin_trylock.c |  28 +
 libpthread/nptl/sysdeps/pthreaddef.h   |  39 +
 libpthread/nptl/sysdeps/sparc/jmpbuf-unwind.h  |  32 +-
 libpthread/nptl/sysdeps/sparc/pthread_spin_lock.c  |  44 +-
 .../nptl/sysdeps/sparc/pthread_spin_trylock.c  |  33 +-
 libpthread/nptl/sysdeps/sparc/pthreaddef.h |  44 +-
 .../nptl/sysdeps/sparc/sparc32/jmpbuf-unwind.h |  27 -
 .../nptl/sysdeps/sparc/sparc32/pthread_spin_lock.c |  39 -
 .../sysdeps/sparc/sparc32/pthread_spin_trylock.c   |  28 -
 libpthread/nptl/sysdeps/sparc/sparc32/pthreaddef.h |  39 -
 .../sparc/sparc32/sparcv9/pthread_spin_lock.c  |  38 -
 .../sparc/sparc32/sparcv9/pthread_spin_trylock.c   |   1 -
 .../sparc/sparc32/sparcv9/pthread_spin_unlock.c|   1 -
 .../nptl/sysdeps/sparc/sparc64/jmpbuf-unwind.h |  27 -
 .../nptl/sysdeps/sparc/sparc64/pthread_spin_lock.c |  38 -
 .../sysdeps/sparc/sparc64/pthread_spin_trylock.c   |  33 -
 .../sysdeps/sparc/sparc64/pthread_spin_unlock.c|  29 -
 libpthread/nptl/sysdeps/sparc/sparc64/pthreaddef.h |  39 -
 .../nptl/sysdeps/unix/sysv/linux/sparc/clone.S |   7 +-
 .../nptl/sysdeps/unix/sysv/linux/sparc/pt-vfork.S  |  49 +-
 .../unix/sysv/linux/sparc/pthread_barrier_wait.c   |  94 ++-
 .../nptl/sysdeps/unix/sysv/linux/sparc/sem_post.c  |  52 ++
 .../sysdeps/unix/sysv/linux/sparc/sem_timedwait.c  | 147 
 .../sysdeps/unix/sysv/linux/sparc/sem_trywait.c|  51 ++
 .../nptl/sysdeps/unix/sysv/linux/sparc/sem_wait.c  | 124 +++
 .../sysdeps/unix/sysv/linux/sparc/sparc32/clone.S  |   2 -
 .../unix/sysv/linux/sparc/sparc32/pt-vfork.S   |  44 -
 .../linux/sparc/sparc32/pthread_barrier_wait.c |  93 ---
 .../unix/sysv/linux/sparc/sparc32/sem_post.c   |  52 --
 .../unix/sysv/linux/sparc/sparc32/sem_timedwait.c  | 147 
 .../unix/sysv/linux/sparc/sparc32/sem_trywait.c

sparc64 removal patch too big

2014-09-02 Thread Waldemar Brodkorb
Hi,

Anyone Admin for the mailinglist?
My sparc64 removal patch was set on hold.

best regards
 Waldemar

___
uClibc mailing list
uClibc@uclibc.org
http://lists.busybox.net/mailman/listinfo/uclibc


Re: e2fsprogs 1.42.11 and above fails to build on uclibc

2014-09-01 Thread Waldemar Brodkorb
Hi,
Waldemar Brodkorb wrote,

> Hi Anthony,
> Anthony G. Basile wrote,
> 
> > On 09/01/14 11:32, Waldemar Brodkorb wrote:
> > >Hi Anthony,
> > >Anthony G. Basile wrote,
> > >
> > >>Hi everyone,
> > >>
> > >>I've written a patch to introduce fallocate()/fallocate64() in
> > >>uclibc. This is useful for e2fsprogs which now requires
> > >>fallocate64(). [0]
> > >>
> > >>Before sending the patch, here's some background: e2fsprogs was
> > >>using a direct syscall(__NR_fallocate, ...) in e4defrag which was
> > >>broken [1]. This was removed and replaced by a simple "#error" if
> > >>fallocate64 is not available, which it is not in uclibc, although
> > >>posix_fallocate64 is. Ironically, e2fsprogs calls fallocate64 in
> > >>default mode which is equivalent to posix_fallocate64.  I submitted
> > >>a patch to e2fsprogs to use posix_fallocate in e4defrag[2].  Ted
> > >>Ts'o's response was that they're not equivalent because, according
> > >>to him, some implementations of posix_fallocate fall back on brute
> > >>force zero-ing if the fallocate syscall is not available.  I
> > >>responded [3], but the issue fell off the radar.
> > >>
> > >>Rather than pushing in that direction, I thought perhaps uclibc
> > >>would benefit from the addition of fallocate/fallocate64.  Its a
> > >>straight forward extension of what's already there since
> > >>posix_fallocate syscalls fallocate with mode=0.  We just relax that
> > >>for fallocate.  I didn't add tests because testing is already there
> > >>for posix_fallocate.  I guess we could use test for the different
> > >>modes, but I'm not sure how useful that might be for testing.
> > >
> > >As you working on extending fallocate functions, would it be
> > >possible to fix the test case tst-posix_fallocate64?
> > >
> > >It would be nice to have this fixed, before adding changes to
> > >posix_fallocate64 files, to see if your patch adds any regression
> > >to the existing codebase. What do you think?
> > >
> > >See the test failures here:
> > >http://openadk.org/test/
> > >
> > >May be it is just a simple bug, have not looked into this, yet.
> > >
> > >best regards
> > >  Waldemar
> > >
> > 
> > Strange, I'm not hitting it at my end.  What's even stranger is that
> > tst-posix_fallocate64.c is two lines long and just includes
> > tst-posix_fallocate.c which doesn't fail in your tests.  The tests
> > pass at my end either with or without my patch.  See what's going on
> > at your end.
> 
> It sets TST_POSIX_FALLOCATE64, which is handled separately in
> tst-posix_fallocate.c. Which uClibc version you are using?
> On which architecture?

Okay, solution is simple, sorry for not checking before mailing.
Test tries to allocate 4 GB, which is not available on my 128 MB
initramfs system

Bernhard: How could I disable this test for small devices?
Adding a config option? 

best regards
Waldemar
___
uClibc mailing list
uClibc@uclibc.org
http://lists.busybox.net/mailman/listinfo/uclibc


Re: e2fsprogs 1.42.11 and above fails to build on uclibc

2014-09-01 Thread Waldemar Brodkorb
Hi Anthony,
Anthony G. Basile wrote,

> On 09/01/14 11:32, Waldemar Brodkorb wrote:
> >Hi Anthony,
> >Anthony G. Basile wrote,
> >
> >>Hi everyone,
> >>
> >>I've written a patch to introduce fallocate()/fallocate64() in
> >>uclibc. This is useful for e2fsprogs which now requires
> >>fallocate64(). [0]
> >>
> >>Before sending the patch, here's some background: e2fsprogs was
> >>using a direct syscall(__NR_fallocate, ...) in e4defrag which was
> >>broken [1]. This was removed and replaced by a simple "#error" if
> >>fallocate64 is not available, which it is not in uclibc, although
> >>posix_fallocate64 is. Ironically, e2fsprogs calls fallocate64 in
> >>default mode which is equivalent to posix_fallocate64.  I submitted
> >>a patch to e2fsprogs to use posix_fallocate in e4defrag[2].  Ted
> >>Ts'o's response was that they're not equivalent because, according
> >>to him, some implementations of posix_fallocate fall back on brute
> >>force zero-ing if the fallocate syscall is not available.  I
> >>responded [3], but the issue fell off the radar.
> >>
> >>Rather than pushing in that direction, I thought perhaps uclibc
> >>would benefit from the addition of fallocate/fallocate64.  Its a
> >>straight forward extension of what's already there since
> >>posix_fallocate syscalls fallocate with mode=0.  We just relax that
> >>for fallocate.  I didn't add tests because testing is already there
> >>for posix_fallocate.  I guess we could use test for the different
> >>modes, but I'm not sure how useful that might be for testing.
> >
> >As you working on extending fallocate functions, would it be
> >possible to fix the test case tst-posix_fallocate64?
> >
> >It would be nice to have this fixed, before adding changes to
> >posix_fallocate64 files, to see if your patch adds any regression
> >to the existing codebase. What do you think?
> >
> >See the test failures here:
> >http://openadk.org/test/
> >
> >May be it is just a simple bug, have not looked into this, yet.
> >
> >best regards
> >  Waldemar
> >
> 
> Strange, I'm not hitting it at my end.  What's even stranger is that
> tst-posix_fallocate64.c is two lines long and just includes
> tst-posix_fallocate.c which doesn't fail in your tests.  The tests
> pass at my end either with or without my patch.  See what's going on
> at your end.

It sets TST_POSIX_FALLOCATE64, which is handled separately in
tst-posix_fallocate.c. Which uClibc version you are using?
On which architecture?
 
best regards
 Waldemar
___
uClibc mailing list
uClibc@uclibc.org
http://lists.busybox.net/mailman/listinfo/uclibc


Re: e2fsprogs 1.42.11 and above fails to build on uclibc

2014-09-01 Thread Waldemar Brodkorb
Hi Anthony,
Anthony G. Basile wrote,

> Hi everyone,
> 
> I've written a patch to introduce fallocate()/fallocate64() in
> uclibc. This is useful for e2fsprogs which now requires
> fallocate64(). [0]
> 
> Before sending the patch, here's some background: e2fsprogs was
> using a direct syscall(__NR_fallocate, ...) in e4defrag which was
> broken [1]. This was removed and replaced by a simple "#error" if
> fallocate64 is not available, which it is not in uclibc, although
> posix_fallocate64 is. Ironically, e2fsprogs calls fallocate64 in
> default mode which is equivalent to posix_fallocate64.  I submitted
> a patch to e2fsprogs to use posix_fallocate in e4defrag[2].  Ted
> Ts'o's response was that they're not equivalent because, according
> to him, some implementations of posix_fallocate fall back on brute
> force zero-ing if the fallocate syscall is not available.  I
> responded [3], but the issue fell off the radar.
> 
> Rather than pushing in that direction, I thought perhaps uclibc
> would benefit from the addition of fallocate/fallocate64.  Its a
> straight forward extension of what's already there since
> posix_fallocate syscalls fallocate with mode=0.  We just relax that
> for fallocate.  I didn't add tests because testing is already there
> for posix_fallocate.  I guess we could use test for the different
> modes, but I'm not sure how useful that might be for testing.

As you working on extending fallocate functions, would it be
possible to fix the test case tst-posix_fallocate64?

It would be nice to have this fixed, before adding changes to
posix_fallocate64 files, to see if your patch adds any regression
to the existing codebase. What do you think?

See the test failures here:
http://openadk.org/test/

May be it is just a simple bug, have not looked into this, yet.
 
best regards
 Waldemar
___
uClibc mailing list
uClibc@uclibc.org
http://lists.busybox.net/mailman/listinfo/uclibc


[PATCH 1/3] test: disable test when UCLIBC_HAS_XLOCALE is n

2014-08-31 Thread Waldemar Brodkorb
wcsftime() is only implemented when locale support in uClibc
is activated. So test will always fail when locale is deactivated
by the user. Rename file name to be consistent with other test file
names.

Signed-off-by: Waldemar Brodkorb 
---
 test/time/Makefile.in|  2 +-
 test/time/tst-wcsftime.c | 39 +++
 test/time/tst_wcsftime.c | 39 ---
 3 files changed, 40 insertions(+), 40 deletions(-)
 create mode 100644 test/time/tst-wcsftime.c
 delete mode 100644 test/time/tst_wcsftime.c

diff --git a/test/time/Makefile.in b/test/time/Makefile.in
index 05f73a4..3f1d1a1 100644
--- a/test/time/Makefile.in
+++ b/test/time/Makefile.in
@@ -5,7 +5,7 @@ TESTS_DISABLED := bug-asctime bug-asctime_r time tst-mktime2 
tst-posixtz \
tst-strftime tst-strptime tst-timezone
 
 ifneq ($(UCLIBC_HAS_XLOCALE),y)
-TESTS_DISABLED += tst-ftime_l
+TESTS_DISABLED += tst-ftime_l tst-wcsftime
 endif
 
 CFLAGS_tst-strptime2 := -std=c99
diff --git a/test/time/tst-wcsftime.c b/test/time/tst-wcsftime.c
new file mode 100644
index 000..6e35f1e
--- /dev/null
+++ b/test/time/tst-wcsftime.c
@@ -0,0 +1,39 @@
+#include 
+#include 
+#include 
+#ifdef __UCLIBC_HAS_WCHAR__
+#include 
+
+int
+main (int argc, char *argv[])
+{
+  wchar_t buf[200];
+  time_t t;
+  struct tm *tp;
+  int result = 0;
+  size_t n;
+
+  time (&t);
+  tp = gmtime (&t);
+
+  n = wcsftime (buf, sizeof (buf) / sizeof (buf[0]),
+   L"%H:%M:%S  %Y-%m-%d\n", tp);
+  if (n != 21)
+result = 1;
+
+  wprintf (L"It is now %ls", buf);
+
+  wcsftime (buf, sizeof (buf) / sizeof (buf[0]), L"%A\n", tp);
+
+  wprintf (L"The weekday is %ls", buf);
+
+  return result;
+}
+
+#else
+int main(void)
+{
+   puts("Test requires WCHAR support; skipping");
+   return 0;
+}
+#endif
diff --git a/test/time/tst_wcsftime.c b/test/time/tst_wcsftime.c
deleted file mode 100644
index 6e35f1e..000
--- a/test/time/tst_wcsftime.c
+++ /dev/null
@@ -1,39 +0,0 @@
-#include 
-#include 
-#include 
-#ifdef __UCLIBC_HAS_WCHAR__
-#include 
-
-int
-main (int argc, char *argv[])
-{
-  wchar_t buf[200];
-  time_t t;
-  struct tm *tp;
-  int result = 0;
-  size_t n;
-
-  time (&t);
-  tp = gmtime (&t);
-
-  n = wcsftime (buf, sizeof (buf) / sizeof (buf[0]),
-   L"%H:%M:%S  %Y-%m-%d\n", tp);
-  if (n != 21)
-result = 1;
-
-  wprintf (L"It is now %ls", buf);
-
-  wcsftime (buf, sizeof (buf) / sizeof (buf[0]), L"%A\n", tp);
-
-  wprintf (L"The weekday is %ls", buf);
-
-  return result;
-}
-
-#else
-int main(void)
-{
-   puts("Test requires WCHAR support; skipping");
-   return 0;
-}
-#endif
-- 
1.8.5.2 (Apple Git-48)

___
uClibc mailing list
uClibc@uclibc.org
http://lists.busybox.net/mailman/listinfo/uclibc


[PATCH 3/3] ldso: fix compile error for bfin non-mmu

2014-08-31 Thread Waldemar Brodkorb
When compiling for bfin non-mmu, you get following error:
ldso/ldso/dl-elf.c:731:18: error: '_dl_debug_file' undeclared (first use in 
this function)
_dl_debug_file is only available when __SUPPORT_LD_DEBUG__ is
defined.

Signed-off-by: Waldemar Brodkorb 
---
 ldso/ldso/dl-elf.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/ldso/ldso/dl-elf.c b/ldso/ldso/dl-elf.c
index 1b06bc1..4c42fbc 100644
--- a/ldso/ldso/dl-elf.c
+++ b/ldso/ldso/dl-elf.c
@@ -728,8 +728,10 @@ struct elf_resolve *_dl_load_elf_shared_library(unsigned 
rflags,
void *new_addr;
new_addr = map_writeable (infile, ppnt, piclib, 
flags, libaddr);
if (!new_addr) {
+#ifdef __SUPPORT_LD_DEBUG__
_dl_dprintf(_dl_debug_file, "Can't 
modify %s's text section.",
libname);
+#endif
_dl_exit(1);
}
DL_UPDATE_LOADADDR_HDR(lib_loadaddr,
-- 
1.8.5.2 (Apple Git-48)

___
uClibc mailing list
uClibc@uclibc.org
http://lists.busybox.net/mailman/listinfo/uclibc


[PATCH 2/3] test: skip test for non-mmu case

2014-08-31 Thread Waldemar Brodkorb
Non-mmu targets have no fork(). In the case of vfork(),
we can not test communication between parent and child
in this way.

Signed-off-by: Waldemar Brodkorb 
---
 test/librt/shmtest.c | 12 
 1 file changed, 12 insertions(+)

diff --git a/test/librt/shmtest.c b/test/librt/shmtest.c
index a14302d..2be09cc 100644
--- a/test/librt/shmtest.c
+++ b/test/librt/shmtest.c
@@ -14,6 +14,8 @@
 #include 
 #include 
 
+#ifdef __ARCH_USE_MMU__
+
 #define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0]))
 
 char shared_name[] = "/sharetest";
@@ -102,3 +104,13 @@ int main(void) {
}
return 0;
 }
+
+#else
+
+int main(void)
+{
+   printf("Skipping test on non-mmu host!\n");
+   return EXIT_SUCCESS;
+}
+
+#endif
-- 
1.8.5.2 (Apple Git-48)

___
uClibc mailing list
uClibc@uclibc.org
http://lists.busybox.net/mailman/listinfo/uclibc


Re: [PATCH] libpthread: modify CFLAGS-pthread_once.c to avoid earlier setting being replaced

2014-08-31 Thread Waldemar Brodkorb
Hi Yang,
Yang Yingliang wrote,

> I use uclibc in arch arm. The CFLAGS-pthread_once.c has been set
> to -DNOT_IN_libc -DIS_IN_libpthread in
> libpthread/nptl/sysdeps/unix/sysv/linux/arm/Makefile.arch.
> But it will be replaced by -fexceptions -fasynchronous-unwind-tables in
> libpthread/nptl/Makefile.in.
> 
> If CFLAGS-pthread_once.c has no -DIS_IN_libpthread the testcase
> tst-once3 in test/nptl/ will be failed. The reason is pthread_once
> calls another pthread_cleanup_push() which is not under IS_IN_libpthread
> so that clear_once_control do not be called when the thread is canceled.
> So pthread_once will hang up when it's called second time.
> 
> Signed-off-by: Yang Yingliang 

You can add a Tested-by: Waldemar Brodkorb 

Fixes my tst-once3 problem on at least arm and mips.
http://openadk.org/test/

best regards
 Waldemar
___
uClibc mailing list
uClibc@uclibc.org
http://lists.busybox.net/mailman/listinfo/uclibc


Re: arm: getpid() when creating a new process with clone, getpid() returns a wrong pid.

2014-08-31 Thread Waldemar Brodkorb
HI,
wangyufen wrote,

>  Called getpid() When creating a new process with clone(), getpid() returns 
> the father_process's value. 
>  It should be child_process's value.

I think I see the same bug running the testsuite:
http://openadk.org/test/
tst-getpid1 and tst-getpid2 are failing.

Any idea for a patch?

best regards
 Waldemar
 
___
uClibc mailing list
uClibc@uclibc.org
http://lists.busybox.net/mailman/listinfo/uclibc


Re: [PATCH v2 04/12] sparc: add missing pthread_spin_lock/pthread_spin_trylock

2014-08-30 Thread Waldemar Brodkorb
Hi Bernhard,
Bernhard Reutner-Fischer wrote,

> On 29 August 2014 08:06:53 CEST, Waldemar Brodkorb  wrote:
> >Hi Bernhard,
> >Bernhard Reutner-Fischer wrote,
> >
> >> On Thu, Aug 28, 2014 at 12:31:22PM +0200, Waldemar Brodkorb wrote:
> 
> 
> >Is uCLibc usable and tested in any way for Sparc64?
> 
> I don't think it is complete, no. I think Austin added just a stub but never 
> continued it. We might as well remove it completely until someone interested 
> in sparc64 comes along with patches.
> 
> thanks,

I agree here. uClibc focus is on embedded systems, I don't know any
sparc64/sparcv9 embedded hardware. Gaisler's leon3/leon4 is
sparc32/sparcv8. My old Javastation Krups is sparc32/sparcv8, too.

In which way you would accept removal of sparc64/sparcv9 stuff.
One big patch? Many small patches?

best regards
 Waldemar
 
___
uClibc mailing list
uClibc@uclibc.org
http://lists.busybox.net/mailman/listinfo/uclibc


hush for non-mmu system

2014-08-30 Thread Waldemar Brodkorb
Hi,

I am recently started exploring the Linux non-MMU world.
The target is qemu-system-m68k with emulation for coldfire m5208
CPU.

A basic boot with simpleinit and sash from the uClinux project is
working fine. But when I switch to busybox init and hush, hush
segfaults after the first executed command. See following
strace started from /etc/init.d/rcS:

/ # restart_syscall(<... resuming interrupted call ...>) = 1
read(0, "l", 1) = 1
write(1, "l", 1l)= 1
poll([{fd=0, events=POLLIN}], 1, -1)= 1 ([{fd=0,
revents=POLLIN}])
read(0, "s", 1) = 1
write(1, "s", 1s)= 1
poll([{fd=0, events=POLLIN}], 1, -1)= 1 ([{fd=0,
revents=POLLIN}])
read(0, "\n", 1)= 1
write(1, "\n", 1
)   = 1
mmap2(NULL, 7, PROT_READ|PROT_WRITE,
MAP_SHARED|MAP_ANONYMOUS|MAP_UNINITIALIZED, 0, 0) = 0x41d9
open("/.hush_history", O_WRONLY|O_CREAT|O_APPEND|O_LARGEFILE, 0600)
= 3
_llseek(3, 0, [0], SEEK_END)= 0
write(3, "ls\n", 3) = 3
close(3)= 0
ioctl(0, SNDCTL_TMR_START or SNDRV_TIMER_IOCTL_TREAD or TCSETS,
{B115200 opost isig icanon echo ...}) = 0
ioctl(0, SNDCTL_TMR_TIMEBASE or SNDRV_TIMER_IOCTL_NEXT_DEVICE or
TCGETS, {B115200 opost isig icanon echo ...}) = 0
rt_sigaction(SIGWINCH, {SIG_DFL, [WINCH], SA_RESTART}, {0x41d7cff0,
[WINCH], SA_RESTART}, 8) = 0
munmap(0x419b8000, 9)   = 0
munmap(0x419b4000, 9)   = 0
munmap(0x419b6000, 10)  = 0
munmap(0x419b, 64)  = 0
mmap2(NULL, 133, PROT_READ|PROT_WRITE,
MAP_SHARED|MAP_ANONYMOUS|MAP_UNINITIALIZED, 0, 0) = 0x419b8000
mmap2(NULL, 7, PROT_READ|PROT_WRITE,
MAP_SHARED|MAP_ANONYMOUS|MAP_UNINITIALIZED, 0, 0) = 0x419b
mmap2(NULL, 12, PROT_READ|PROT_WRITE,
MAP_SHARED|MAP_ANONYMOUS|MAP_UNINITIALIZED, 0, 0) = 0x419b4000
mmap2(NULL, 76, PROT_READ|PROT_WRITE,
MAP_SHARED|MAP_ANONYMOUS|MAP_UNINITIALIZED, 0, 0) = 0x419b6000
munmap(0x419fe000, 40)  = 0
mmap2(NULL, 48, PROT_READ|PROT_WRITE,
MAP_SHARED|MAP_ANONYMOUS|MAP_UNINITIALIZED, 0, 0) = 0x419fe000
mmap2(NULL, 40, PROT_READ|PROT_WRITE,
MAP_SHARED|MAP_ANONYMOUS|MAP_UNINITIALIZED, 0, 0) = 0x41d94000
munmap(0x419f8000, 133) = 0
munmap(0x419b8000, 133) = 0
mmap2(NULL, 69, PROT_READ|PROT_WRITE,
MAP_SHARED|MAP_ANONYMOUS|MAP_UNINITIALIZED, 0, 0) = 0x419b8000
mmap2(NULL, 197, PROT_READ|PROT_WRITE,
MAP_SHARED|MAP_ANONYMOUS|MAP_UNINITIALIZED, 0, 0) = 0x419f8000
munmap(0x419b8000, 69)  = 0
vfork() = 29
munmap(0x419f8000, 197) = 0
wait4(-1, bindevlibmntroot   sysusr
boot   etcmedia  proc   sbin   tmpvar
[{WIFEXITED(s) && WEXITSTATUS(s) == 0}], WSTOPPED, NULL) = 29
--- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=29,
si_status=0, si_utime=0, si_stime=0} ---
sigreturn() (mask [HUP TRAP])   = 29
rt_sigreturn()  = 0
--- SIGSEGV {si_signo=SIGSEGV, si_code=SI_KERNEL, si_addr=0} ---
+++ killed by SIGSEGV +++

After that the system is unresponsible. It is unimportant which
command is executed. (ps, ls, ..)

As the C library of the system I use uClibc (git master).
The busybox version is 1.22.1. My inittab is:
null::sysinit:/bin/mount -t proc proc /proc
null::sysinit:/bin/mount -t sysfs sys /sys
null::sysinit:/bin/mkdir -p /dev/pts
null::sysinit:/bin/mkdir -p /dev/shm
null::sysinit:/bin/mount -a -t devpts
null::sysinit:/bin/mount -a -t tmpfs
::sysinit:/etc/init.d/rcS
::shutdown:/etc/init.d/rcK
null::shutdown:/bin/umount -a
null::shutdown:/sbin/swapoff -a
ttyS0::respawn:/sbin/getty -i -L ttyS0 115200 vt100

Attached is my uclibc.config and busybox.config. 
Same happens when starting a system with simpleinit/sash and then
executing hush. So I think uClibc vfork is fine, but hush has a bug?
Any ideas what is wrong here?

best regards
 Waldemar

#
# Automatically generated file; DO NOT EDIT.
# uClibc 0.9.34-git C Library Configuration
#
# TARGET_alpha is not set
# TARGET_arc is not set
# TARGET_arm is not set
# TARGET_avr32 is not set
# TARGET_bfin is not set
# TARGET_c6x is not set
# TARGET_cris is not set
# TARGET_e1 is not set
# TARGET_frv is not set
# TARGET_h8300 is not set
# TARGET_hppa is not set
# TARGET_i386 is not set
# TARGET_i960 is not set
# TARGET_ia64 is not set
TARGET_m68k=y
# TARGET_metag is not set
# TARGET_microblaze is not set
# TARGET_mips is not set
# TARGET_nios is not set
# TARGET_nios2 is not set
# TARGET_powerpc is not set
# TARGET_sh is not set
# TARGET_sh64 is not set
# TARGET_sparc is not set
# TARGET_v850 is not set
# TARGET_vax is not set
# TARGET_x86_64 is not set
# TARGET_xtensa is not set

#
# Target Architecture Features and Options
#
TARGET_ARCH="m68k"
FORCE_OPTIONS_FOR_ARCH=y
TARGET_SUBARCH=""
# UCLIBC_FORMAT_FLAT is not set
UCLIBC_FORMAT_FLAT_SEP_DATA=y
# UCLIBC_FORMAT_SHARED_FLAT is not set
A

Re: Multiple definition of vfork() when linking statically

2014-08-29 Thread Waldemar Brodkorb
Hi Thomas,
Thomas Petazzoni wrote,

> Hello,
> 
> When doing static linking, vfork() is defined in both libc.a and
> libpthread.a, causing a build failure such as:
> 
> aserver.c:(.text.startup+0x464): warning: gethostbyname is obsolescent, use 
> getnameinfo() instead.
> /home/test/autobuild/instance-1/output/host/usr/sh4-buildroot-linux-uclibc/sysroot/usr/lib/libc.a(vfork.os):
>  In function `vfork':
> (.text+0x0): multiple definition of `__vfork'
> /home/test/autobuild/instance-1/output/host/usr/sh4-buildroot-linux-uclibc/sysroot/usr/lib/libpthread.a(pt-vfork.os):(.text+0x0):
>  first defined here
> collect2: error: ld returned 1 exit status
> 
> This happens with uClibc 0.9.33.2 + the set of patches visible at
> http://git.buildroot.net/buildroot/tree/package/uclibc/0.9.33.2?id=2014.05-rc1.

21 /* libpthread used to have its own vfork implementation that differed
22from libc's only in having a pointless micro-optimization.  There
23is no longer any use to having a separate copy in libpthread, but
24the historical ABI requires it.  For static linking, there is no
25need to provide anything here--the libc version will be linked in.
26For shared library ABI compatibility, there must be __vfork and
27vfork symbols in libpthread.so.  */
28
29 #if (SHLIB_COMPAT (libpthread, GLIBC_2_0, GLIBC_2_20) \
30  || SHLIB_COMPAT (libpthread, GLIBC_2_1_2, GLIBC_2_20))
31
32 #include 
33
34 #endif
35
36 #if SHLIB_COMPAT (libpthread, GLIBC_2_0, GLIBC_2_20)
37 compat_symbol (libpthread, __libc_vfork, vfork, GLIBC_2_0);
38 #endif
39
40 #if SHLIB_COMPAT (libpthread, GLIBC_2_1_2, GLIBC_2_20)
41 strong_alias (__libc_vfork, __vfork_compat)
42 compat_symbol (libpthread, __vfork_compat, __vfork, GLIBC_2_1_2);
43 #endif

Any volunteers to come up with a patch for uClibc mimic the
changes of glibc for pt-vfork.S?

best regards
 Waldemar
___
uClibc mailing list
uClibc@uclibc.org
http://lists.busybox.net/mailman/listinfo/uclibc


Re: [PATCH v2 04/12] sparc: add missing pthread_spin_lock/pthread_spin_trylock

2014-08-28 Thread Waldemar Brodkorb
Hi Bernhard,
Bernhard Reutner-Fischer wrote,

> On Thu, Aug 28, 2014 at 12:31:22PM +0200, Waldemar Brodkorb wrote:
> > tst-spin1.c compile breaks with:
> > test/nptl/tst-spin1.c:34: undefined reference to `pthread_spin_lock'
> > 
> > pthread_spin_lock and pthread_spin_trylock is missing while
> > building sparc. add the meta c files here.
> 
> 1) what about pthread_spin_unlock?

Yeah, I need to check this. I put it on my TODO.

> 2) wouldn't it be nicer to teach
>libpthread/nptl/sysdeps/sparc/Makefile.arch which of sparc32/sparc64
>it should use?

Depends.

> 3) As you have seen (and removed the typoed subdirs), there is a
>specialization for sparcv9 there which should probably be used.
> 
> Applied the below in the meantime, thanks!

Is uCLibc usable and tested in any way for Sparc64?
May be I got it wrong. Here how I understand the Sparc architecture
stuff:
- There are mainly three different instruction sets:
  SPARCv7
  SPARCv8
  SPARCv9

SPARCv7 is for older 32 Bit systems and should also work for every
other 32 Bit sparc system. SPARCv8 is the preferred 32 Bit
instruction set. This is what I test with qemu-system-sparc.
And there is SPARCv9 which is used for 64 Bit sparc systems.
I use "ultrasparc" gcc optimization for qemu-system-sparc64 and
glibc. Using either v9a or v9b doesn't work for Linux for me.

And then I have read about SPARCv8+, which can be used for
Sparc64 systems with a 32 Bit userland. (like x32 for x86_64?)

So what exactly you mean?

When just trying to use uClibc for sparc64 with CONFIG_SPARC_V9=y
I get following error:
libc/sysdeps/linux/sparc/__longjmp.S: Assembler messages:
libc/sysdeps/linux/sparc/__longjmp.S:33: Error: invalid operands
(*UND* and *ABS* sections) for `*'

In glibc __longjmp.S is not used for sparc64, so I am not confident
that uClibc is ever used for sparc64.

best regards
 Waldemar
___
uClibc mailing list
uClibc@uclibc.org
http://lists.busybox.net/mailman/listinfo/uclibc


Re: [PATCH v2 08/12] test: disable test for systems without FPU

2014-08-28 Thread Waldemar Brodkorb
Hi,

thanks for the comments and commits so far.
What about this one?

best regards
 Waldemar

Waldemar Brodkorb wrote,

> This test fails for systems without fpu.
> For example m68k build for non-mmu/non-fpu systems fail.
> 
> Signed-off-by: Waldemar Brodkorb 
> ---
>  test/math/Makefile.in | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/test/math/Makefile.in b/test/math/Makefile.in
> index d241baa..147d579 100644
> --- a/test/math/Makefile.in
> +++ b/test/math/Makefile.in
> @@ -13,6 +13,9 @@ endif
>  ifeq ($(DO_C99_MATH),)
>  TESTS_DISABLED += test-float test-ifloat test-double test-idouble rint 
> signgam ilogb
>  endif
> +ifeq ($(UCLIBC_HAS_FPU),)
> +TESTS_DISABLED += test-fpucw
> +endif
>  
>  DODIFF_rint := 1
>  DODIFF_signgam  := 1
> -- 
> 1.8.5.2 (Apple Git-48)
> 
___
uClibc mailing list
uClibc@uclibc.org
http://lists.busybox.net/mailman/listinfo/uclibc


[PATCH v2 12/12] test: sync with glibc, use do_test

2014-08-28 Thread Waldemar Brodkorb
This breaks out of a deadlock, which occurs when testing for powerpc. (qemu)
Otherwise the test suite does not finish.

Signed-off-by: Waldemar Brodkorb 
---
 test/nptl/tst-sem3.c | 33 ++---
 test/nptl/tst-sem4.c |  7 +--
 2 files changed, 23 insertions(+), 17 deletions(-)

diff --git a/test/nptl/tst-sem3.c b/test/nptl/tst-sem3.c
index d14f6f6..7b75e29 100644
--- a/test/nptl/tst-sem3.c
+++ b/test/nptl/tst-sem3.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002, 2003 Free Software Foundation, Inc.
+/* Copyright (C) 2002-2014 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper , 2002.
 
@@ -28,7 +28,7 @@
 
 
 int
-main (void)
+do_test (void)
 {
   size_t ps = sysconf (_SC_PAGESIZE);
   char tmpfname[] = "/tmp/tst-sem3.XX";
@@ -43,7 +43,7 @@ main (void)
   if (fd == -1)
 {
   printf ("cannot open temporary file: %m\n");
-  exit (1);
+  return 1;
 }
 
   /* Make sure it is always removed.  */
@@ -56,14 +56,14 @@ main (void)
   if (write (fd, data, ps) != (ssize_t) ps)
 {
   puts ("short write");
-  exit (1);
+  return 1;
 }
 
   mem = mmap (NULL, ps, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0);
   if (mem == MAP_FAILED)
 {
   printf ("mmap failed: %m\n");
-  exit (1);
+  return 1;
 }
 
   s = (sem_t *) (((uintptr_t) mem + __alignof (sem_t))
@@ -73,25 +73,25 @@ main (void)
   if (sem_init (s, 1, 1) == -1)
 {
   puts ("init failed");
-  exit (1);
+  return 1;
 }
 
   if (TEMP_FAILURE_RETRY (sem_wait (s)) == -1)
 {
   puts ("1st wait failed");
-  exit (1);
+  return 1;
 }
 
   errno = 0;
   if (TEMP_FAILURE_RETRY (sem_trywait (s)) != -1)
 {
   puts ("trywait succeeded");
-  exit (1);
+  return 1;
 }
   else if (errno != EAGAIN)
 {
   puts ("trywait didn't return EAGAIN");
-  exit (1);
+  return 1;
 }
 
   *p = 0;
@@ -101,7 +101,7 @@ main (void)
   if (pid == -1)
 {
   puts ("fork failed");
-  exit (1);
+  return 1;
 }
   else if (pid == 0)
 {
@@ -109,13 +109,13 @@ main (void)
   if ((*p)++ != 0)
{
  puts ("child: *p != 0");
- exit (1);
+ return 1;
}
 
   if (sem_post (s) == -1)
{
  puts ("child: 1st post failed");
- exit (1);
+ return 1;
}
 
   puts ("child done");
@@ -125,17 +125,20 @@ main (void)
   if (TEMP_FAILURE_RETRY (sem_wait (s)) == -1)
{
  printf ("parent: 2nd wait failed: %m\n");
- exit (1);
+ return 1;
}
 
   if (*p != 1)
{
  puts ("*p != 1");
- exit (1);
+ return 1;
}
 
   puts ("parent done");
 }
 
-  exit (0);
+  return 0;
 }
+
+#define TEST_FUNCTION do_test ()
+#include "../test-skeleton.c"
diff --git a/test/nptl/tst-sem4.c b/test/nptl/tst-sem4.c
index 125759b..72ed97d 100644
--- a/test/nptl/tst-sem4.c
+++ b/test/nptl/tst-sem4.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002 Free Software Foundation, Inc.
+/* Copyright (C) 2002-2014 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper , 2002.
 
@@ -32,7 +32,7 @@ remove_sem (int status, void *arg)
 
 
 int
-main (void)
+do_test (void)
 {
   sem_t *s;
   sem_t *s2;
@@ -144,3 +144,6 @@ main (void)
 
   return 0;
 }
+
+#define TEST_FUNCTION do_test ()
+#include "../test-skeleton.c"
-- 
1.8.5.2 (Apple Git-48)

___
uClibc mailing list
uClibc@uclibc.org
http://lists.busybox.net/mailman/listinfo/uclibc


[PATCH v2 05/12] test: sync WRITE_BUFFER_SIZE with glibc test

2014-08-28 Thread Waldemar Brodkorb
Test on Linux 3.16.1 in Qemu ARM fails with:
 TEST_EXEC nptl/ tst-cancel4
ret == 1 ; expected_ret == 0
make[1]: *** [tst-cancel4.exe] Error 1
The output of failed test is:
minimum write buffer size too large
../Test.mak:89: recipe for target 'tst-cancel4.exe' failed

Signed-off-by: Waldemar Brodkorb 
---
 test/nptl/tst-cancel4.c | 26 --
 1 file changed, 24 insertions(+), 2 deletions(-)

diff --git a/test/nptl/tst-cancel4.c b/test/nptl/tst-cancel4.c
index e711958..53abf83 100644
--- a/test/nptl/tst-cancel4.c
+++ b/test/nptl/tst-cancel4.c
@@ -83,7 +83,30 @@ static pthread_barrier_t b2;
 # define IPC_ADDVAL 0
 #endif
 
-#define WRITE_BUFFER_SIZE 4096
+/* The WRITE_BUFFER_SIZE value needs to be chosen such that if we set
+   the socket send buffer size to '1', a write of this size on that
+   socket will block.
+
+   The Linux kernel imposes a minimum send socket buffer size which
+   has changed over the years.  As of Linux 3.10 the value is:
+
+ 2 * (2048 + SKB_DATA_ALIGN(sizeof(struct sk_buff)))
+
+   which is attempting to make sure that with standard MTUs,
+   TCP can always queue up at least 2 full sized packets.
+
+   Furthermore, there is logic in the socket send paths that
+   will allow one more packet (of any size) to be queued up as
+   long as some socket buffer space remains.   Blocking only
+   occurs when we try to queue up a new packet and the send
+   buffer space has already been fully consumed.
+
+   Therefore we must set this value to the largest possible value of
+   the formula above (and since it depends upon the size of "struct
+   sk_buff", it is dependent upon machine word size etc.) plus some
+   slack space.  */
+
+#define WRITE_BUFFER_SIZE 16384
 
 /* Cleanup handling test.  */
 static int cl_called;
@@ -758,7 +781,6 @@ tf_sigpause (void *arg)
 
   pthread_cleanup_push (cl, NULL);
 
-  /* Just for fun block the cancellation signal.  */
   sigpause (SIGCANCEL);
 
   pthread_cleanup_pop (0);
-- 
1.8.5.2 (Apple Git-48)

___
uClibc mailing list
uClibc@uclibc.org
http://lists.busybox.net/mailman/listinfo/uclibc


[PATCH v2 08/12] test: disable test for systems without FPU

2014-08-28 Thread Waldemar Brodkorb
This test fails for systems without fpu.
For example m68k build for non-mmu/non-fpu systems fail.

Signed-off-by: Waldemar Brodkorb 
---
 test/math/Makefile.in | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/test/math/Makefile.in b/test/math/Makefile.in
index d241baa..147d579 100644
--- a/test/math/Makefile.in
+++ b/test/math/Makefile.in
@@ -13,6 +13,9 @@ endif
 ifeq ($(DO_C99_MATH),)
 TESTS_DISABLED += test-float test-ifloat test-double test-idouble rint signgam 
ilogb
 endif
+ifeq ($(UCLIBC_HAS_FPU),)
+TESTS_DISABLED += test-fpucw
+endif
 
 DODIFF_rint := 1
 DODIFF_signgam  := 1
-- 
1.8.5.2 (Apple Git-48)

___
uClibc mailing list
uClibc@uclibc.org
http://lists.busybox.net/mailman/listinfo/uclibc


[PATCH v2 04/12] sparc: add missing pthread_spin_lock/pthread_spin_trylock

2014-08-28 Thread Waldemar Brodkorb
tst-spin1.c compile breaks with:
test/nptl/tst-spin1.c:34: undefined reference to `pthread_spin_lock'

pthread_spin_lock and pthread_spin_trylock is missing while
building sparc. add the meta c files here.

Signed-off-by: Waldemar Brodkorb 
---
 libpthread/nptl/sysdeps/sparc/pthread_spin_lock.c| 5 +
 libpthread/nptl/sysdeps/sparc/pthread_spin_trylock.c | 5 +
 2 files changed, 10 insertions(+)
 create mode 100644 libpthread/nptl/sysdeps/sparc/pthread_spin_lock.c
 create mode 100644 libpthread/nptl/sysdeps/sparc/pthread_spin_trylock.c

diff --git a/libpthread/nptl/sysdeps/sparc/pthread_spin_lock.c 
b/libpthread/nptl/sysdeps/sparc/pthread_spin_lock.c
new file mode 100644
index 000..dcc5ae2
--- /dev/null
+++ b/libpthread/nptl/sysdeps/sparc/pthread_spin_lock.c
@@ -0,0 +1,5 @@
+#if defined(__arch64__)
+#include "sparc64/pthread_spin_lock.c"
+#else
+#include "sparc32/pthread_spin_lock.c"
+#endif
diff --git a/libpthread/nptl/sysdeps/sparc/pthread_spin_trylock.c 
b/libpthread/nptl/sysdeps/sparc/pthread_spin_trylock.c
new file mode 100644
index 000..af63eec
--- /dev/null
+++ b/libpthread/nptl/sysdeps/sparc/pthread_spin_trylock.c
@@ -0,0 +1,5 @@
+#if defined(__arch64__)
+#include "sparc64/pthread_spin_trylock.c"
+#else
+#include "sparc32/pthread_spin_trylock.c"
+#endif
-- 
1.8.5.2 (Apple Git-48)

___
uClibc mailing list
uClibc@uclibc.org
http://lists.busybox.net/mailman/listinfo/uclibc


[PATCH v2 10/12] test: disable tst_wcsftime

2014-08-28 Thread Waldemar Brodkorb
Feature is not implemented in uClibc, so no need to do a test.

Signed-off-by: Waldemar Brodkorb 
---
 test/time/Makefile.in | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/test/time/Makefile.in b/test/time/Makefile.in
index 05f73a4..7bb5fb4 100644
--- a/test/time/Makefile.in
+++ b/test/time/Makefile.in
@@ -2,7 +2,7 @@
 # Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
 
 TESTS_DISABLED := bug-asctime bug-asctime_r time tst-mktime2 tst-posixtz \
-   tst-strftime tst-strptime tst-timezone
+   tst-strftime tst-strptime tst-timezone tst_wcsftime
 
 ifneq ($(UCLIBC_HAS_XLOCALE),y)
 TESTS_DISABLED += tst-ftime_l
-- 
1.8.5.2 (Apple Git-48)

___
uClibc mailing list
uClibc@uclibc.org
http://lists.busybox.net/mailman/listinfo/uclibc


[PATCH v2 03/12] sparc: remove unused subdirs variable

2014-08-28 Thread Waldemar Brodkorb
For sparc TARGET_SUBARCH is never used. And there is a typo in the
path.

Signed-off-by: Waldemar Brodkorb 
---
 libpthread/nptl/sysdeps/sparc/Makefile.arch | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/libpthread/nptl/sysdeps/sparc/Makefile.arch 
b/libpthread/nptl/sysdeps/sparc/Makefile.arch
index 52ac6db..f9662c6 100644
--- a/libpthread/nptl/sysdeps/sparc/Makefile.arch
+++ b/libpthread/nptl/sysdeps/sparc/Makefile.arch
@@ -4,8 +4,5 @@
 #
 # Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
 #
-subdirs += libpthread/nptl/sysdeps/$(TARGET_ARCH)/$(TARGET_SUBARCH)/sparv9
 
 CFLAGS-pthread_spin_lock.c += -D_GNU_SOURCE
-
-
-- 
1.8.5.2 (Apple Git-48)

___
uClibc mailing list
uClibc@uclibc.org
http://lists.busybox.net/mailman/listinfo/uclibc


[PATCH v2 07/12] test: disable test for non-MMU systems

2014-08-28 Thread Waldemar Brodkorb
This test fails for non-MMU systems, because it uses fork()

Signed-off-by: Waldemar Brodkorb 
---
 test/Makefile | 4 
 1 file changed, 4 insertions(+)

diff --git a/test/Makefile b/test/Makefile
index 787c530..d51bb62 100644
--- a/test/Makefile
+++ b/test/Makefile
@@ -42,6 +42,10 @@ endif
 ifeq ($(HAS_NO_THREADS),y)
DIRS := $(filter-out pthread,$(DIRS))
 endif
+# librt test needs fork()
+ifneq ($(ARCH_USE_MMU),y)
+   DIRS := $(filter-out librt,$(DIRS))
+endif
 
 test check all: run
 
-- 
1.8.5.2 (Apple Git-48)

___
uClibc mailing list
uClibc@uclibc.org
http://lists.busybox.net/mailman/listinfo/uclibc


[PATCH v2 01/12] Revert "sparc: use HIDDEN_JUMPTARGET for errno"

2014-08-28 Thread Waldemar Brodkorb
This reverts commit f51fb26dbcceee9e48d10facc830bd4a549f6cc2.

This fixes linking error for sparc build.
While building a sparc system you get following linking error:
libc/sysdeps/linux/sparc/pipe.S:54: undefined reference to 
`__GI___errno_location'

Removing the HIDDEN_JUMPTARGET fixes the issue, while using gcc 4.8.3/binutils 
2.24.

The definition of __errno_location was changed recently here:
http://git.uclibc.org/uClibc/commit/?id=8f550715c2b211036fc273add3cb5219397ed312

Signed-off-by: Waldemar Brodkorb 
---
 libc/sysdeps/linux/sparc/fork.S  | 2 +-
 libc/sysdeps/linux/sparc/pipe.S  | 2 +-
 libc/sysdeps/linux/sparc/vfork.S | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/libc/sysdeps/linux/sparc/fork.S b/libc/sysdeps/linux/sparc/fork.S
index 8e4bc22..1715911 100644
--- a/libc/sysdeps/linux/sparc/fork.S
+++ b/libc/sysdeps/linux/sparc/fork.S
@@ -35,7 +35,7 @@ fork:
bcc,a   9000f
nop
save%sp,-96,%sp
-   call HIDDEN_JUMPTARGET(__errno_location)
+   call __errno_location
nop
st  %i0,[%o0]
jmpl%i7+8,%g0
diff --git a/libc/sysdeps/linux/sparc/pipe.S b/libc/sysdeps/linux/sparc/pipe.S
index b085faf..fa77f4d 100644
--- a/libc/sysdeps/linux/sparc/pipe.S
+++ b/libc/sysdeps/linux/sparc/pipe.S
@@ -49,7 +49,7 @@ pipe:
 restore %g0,%g0,%o0
 
 .Lerror:
-   callHIDDEN_JUMPTARGET(__errno_location)
+   call__errno_location
 or %g0,EINVAL,%i0
st  %i0,[%o0]
ret
diff --git a/libc/sysdeps/linux/sparc/vfork.S b/libc/sysdeps/linux/sparc/vfork.S
index 4b701f7..e5a3c30 100644
--- a/libc/sysdeps/linux/sparc/vfork.S
+++ b/libc/sysdeps/linux/sparc/vfork.S
@@ -37,7 +37,7 @@ __vfork:
bcc,a   9000f
nop
save%sp,-96,%sp
-   call HIDDEN_JUMPTARGET(__errno_location)
+   call __errno_location
nop
st  %i0,[%o0]
jmpl%i7+8,%g0
-- 
1.8.5.2 (Apple Git-48)

___
uClibc mailing list
uClibc@uclibc.org
http://lists.busybox.net/mailman/listinfo/uclibc


[PATCH v2 02/12] Revert "sparc: disable cancellable system, as it fails in strange ways right now"

2014-08-28 Thread Waldemar Brodkorb
This reverts commit 1db4f8f8389f6a935ecd83aff7fcce5d1cf2c0f3.

It is unclear in which way this is breaking sparc systems.
With this change added you get following linking error:
libpthread/nptl/libpthread_so.a(pt-system.oS): In function `__libc_system':
libc/stdlib/system.c:64: undefined reference to `__wait4_nocancel'

Signed-off-by: Waldemar Brodkorb 
---
 libc/stdlib/system.c | 13 +++--
 1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/libc/stdlib/system.c b/libc/stdlib/system.c
index 151a229..8c5d25d 100644
--- a/libc/stdlib/system.c
+++ b/libc/stdlib/system.c
@@ -18,13 +18,14 @@
 #include 
 #endif
 
-extern __typeof(system) __libc_system;
-
-/* TODO: the cancellable version breaks on sparc currently,
- * need to figure out why still
- */
-#if !defined __UCLIBC_HAS_THREADS_NATIVE__ || defined __sparc__
+#if !defined __UCLIBC_HAS_THREADS_NATIVE__
+/* uClinux-2.0 has vfork, but Linux 2.0 doesn't */
+#include 
+#ifndef __NR_vfork
+# define vfork fork
+#endif
 
+extern __typeof(system) __libc_system;
 int __libc_system(const char *command)
 {
int wait_val, pid;
-- 
1.8.5.2 (Apple Git-48)

___
uClibc mailing list
uClibc@uclibc.org
http://lists.busybox.net/mailman/listinfo/uclibc


[PATCH v2 11/12] test: get out of the endless while loop, when bind failed

2014-08-28 Thread Waldemar Brodkorb
When bind() fails in this test, then /tmp get filled up with
temp files and upcoming tests will fail, because they need to create
temp files, too. Better exit from the loop.
Test still needs to be investigated to fix the failing bind().

Signed-off-by: Waldemar Brodkorb 
---
 test/nptl/tst-cancel4.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/test/nptl/tst-cancel4.c b/test/nptl/tst-cancel4.c
index 53abf83..4ba4045 100644
--- a/test/nptl/tst-cancel4.c
+++ b/test/nptl/tst-cancel4.c
@@ -1015,6 +1015,8 @@ tf_accept (void *arg)
   if (++tries > 10)
{
  printf ("%s: too many unsuccessful bind calls\n", __FUNCTION__);
+ /* prevent endless loop, when bind fails forever */
+ exit (1);
}
 
   strcpy (sun.sun_path, "/tmp/tst-cancel4-socket-1-XX");
-- 
1.8.5.2 (Apple Git-48)

___
uClibc mailing list
uClibc@uclibc.org
http://lists.busybox.net/mailman/listinfo/uclibc


[PATCH v2 09/12] m68k: fix typo

2014-08-28 Thread Waldemar Brodkorb
otherwise you get compile warnings, when building for m68k.

Signed-off-by: Waldemar Brodkorb 
---
 libc/sysdeps/linux/m68k/bits/huge_vall.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libc/sysdeps/linux/m68k/bits/huge_vall.h 
b/libc/sysdeps/linux/m68k/bits/huge_vall.h
index c44b64d..674b46d 100644
--- a/libc/sysdeps/linux/m68k/bits/huge_vall.h
+++ b/libc/sysdeps/linux/m68k/bits/huge_vall.h
@@ -26,7 +26,7 @@
 # define HUGE_VALL (__builtin_huge_vall ())
 #elif __GNUC_PREREQ(2,96)
 # define HUGE_VALL (__extension__ 0x1.0p32767L)
-#elif defined__GNUC__
+#elif defined __GNUC__
 
 # define HUGE_VALL \
   (__extension__   \
-- 
1.8.5.2 (Apple Git-48)

___
uClibc mailing list
uClibc@uclibc.org
http://lists.busybox.net/mailman/listinfo/uclibc


[PATCH v2 06/12] test: do not depend on compile

2014-08-28 Thread Waldemar Brodkorb
When you cross-compile the testsuite and then try to run
on a system without gcc/binutils it would be nice if no compiling
or linking is tried. Refresh test/README (suggested by Khem)

Signed-off-by: Waldemar Brodkorb 
---
 test/Makefile | 2 +-
 test/README   | 5 ++---
 2 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/test/Makefile b/test/Makefile
index b759bf9..787c530 100644
--- a/test/Makefile
+++ b/test/Makefile
@@ -45,7 +45,7 @@ endif
 
 test check all: run
 
-run: compile subdirs_run
+run: subdirs_run
 
 compile: $(top_builddir)$(LOCAL_INSTALL_PATH) subdirs_compile
 
diff --git a/test/README b/test/README
index 8fb12d9..28225b0 100644
--- a/test/README
+++ b/test/README
@@ -5,12 +5,11 @@ Following make targets are avaialable
 
 make compile
 
-This will compile and link the tests
+This will compile and link the tests.
 
 make run
 
-This will check for binaries, if they are not there it
-will call 'compile' target, then it will execute all the tests.
+This will execute all the tests.
 
 make check
 make all
-- 
1.8.5.2 (Apple Git-48)

___
uClibc mailing list
uClibc@uclibc.org
http://lists.busybox.net/mailman/listinfo/uclibc


  1   2   >