[PATCH, libstdc++] Fix detection of posix_memalig for cross-builds

Jonathan Wakely jwakely@redhat.com
Wed Nov 30 23:10:00 GMT 2016


On 30/11/16 23:06 +0100, Christophe Lyon wrote:
>On 30 November 2016 at 22:51, Jonathan Wakely <jwakely@redhat.com> wrote:
>> On 30/11/16 22:32 +0100, Christophe Lyon wrote:
>>>
>>> On 30 November 2016 at 20:00, Bernd Edlinger <bernd.edlinger@hotmail.de>
>>> wrote:
>>>>
>>>> Hi,
>>>>
>>>> I noticed that a cross-compiler produces an unusable libstdc++.so
>>>> that contains an unresolved reference to aligned_alloc instead of
>>>> posix_memalign, or whatever is actually available.
>>>>
>>>> Therefore it is impossible to link any C++ programs against the
>>>> libstdc++.so that comes with the cross-compiler.
>>>>
>>>> That happens for instance in the following configuration:
>>>> --target=arm-linux-gnueabihf.
>>>>
>>>
>>> How could this be unnoticed so far?
>>
>>
>> I did wonder that.
>>
>> The newlib config is hardcoded, which probably covers a lot of the
>> cross builds in regular use.
>>
>The config mentioned by Bernd (arm-linux-gnueabihf) does not use newlib.
>I checked my libstdc++.log files, there's no -static option in use, I don't
>use --disable-shared, so I'm not sure why there's a problem?

Then you probably have a newer glibc that defines aligned_alloc, and
Bernd is using an older one that doesn't define it. Bernd?



More information about the Libstdc++ mailing list