Bug 6218

Summary: binutils-2.23.2/gas fails with undefined reference to `mbstowcs'
Product: buildroot Reporter: Adam Nielsen <a.nielsen>
Component: OtherAssignee: unassigned
Status: RESOLVED WORKSFORME    
Severity: normal CC: buildroot
Priority: P5    
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Linux   
Host: Target:
Build:

Description Adam Nielsen 2013-04-25 10:29:05 UTC
I am building for arm7tdmi using the git version of buildroot, with binutils-2.23.2, but it fails:

libtool: link: [...] -o as-new [...]
read.o: In function `read_symbol_name':
read.c:(.text+0x3634): undefined reference to `mbstowcs'
collect2: error: ld returned 1 exit status
make[5]: *** [as-new] Error 1
make[5]: Leaving directory `buildroot/build/binutils-2.23.2/gas'
make[4]: *** [all-recursive] Error 1
make[4]: Leaving directory `buildroot/build/binutils-2.23.2/gas'
make[3]: *** [all] Error 2
make[3]: Leaving directory `buildroot/build/binutils-2.23.2/gas'
make[2]: *** [all-gas] Error 2
make[2]: Leaving directory `buildroot/build/binutils-2.23.2'
make[1]: *** [all] Error 2
make[1]: Leaving directory `buildroot/build/binutils-2.23.2'
Comment 1 Thomas Petazzoni 2013-04-25 13:36:58 UTC
Does this happen after a complete 'make clean; make' cycle?

If so, could you attach your Buildroot .config file to the bug?

Thanks!
Comment 2 Thomas Petazzoni 2013-05-26 13:36:14 UTC
Adam, do you still have this problem? If so, would you mind answering the questions asked on April, 25th in this bug report, so that we can investigate?
Comment 3 Thomas De Schampheleire 2014-02-13 15:02:35 UTC
I built a toolchain based on current buildroot git (more or less 2014.02-rc1), for arm7tdmi, using binutils-2.23.2, and did not see any problem.
Comment 4 Thomas De Schampheleire 2014-02-14 11:53:46 UTC
No response on questions from submitter, and problem not reproducible: this bug will be closed. 

Please reopen if you still experience the same problem, and provide more details.
Comment 5 Alexey Brodkin 2014-08-18 15:22:57 UTC
This happens on ARC too when building native binutils.
It's because in uClibc "mbstowcs" is only gets built-in if WCHAR support is enabled.

So proper fix would be to add WCHAR support in toolchain as a dependency for native binutils.