Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Tue, 14 Jun 2016 10:40:54 -0700
From: "Zhao, Weiming" <>
Subject: Re: build musl for armv7m

Please review the changes.

I'm able to build libc.a with -mcpu=cortex-m3 -Wa,-implicit-it=always 
using clang + gas



On 6/14/2016 9:58 AM, Zhao, Weiming wrote:
> Thank you, Szabolcs.
> It's GAS-only flag, clang's integrated-as doesn't support it. I can 
> use -no-integrated-as.
> It also expose other errors:
> src/thread/arm/atomics.s:9: Error: cannot use register index with 
> PC-relative addressing -- `ldr ip,[pc,ip]'
> Clang's integrated-as accepts it but seems encoded incorrectly.
> I can fix it.
> On 6/14/2016 9:32 AM, Szabolcs Nagy wrote:
>> * Zhao, Weiming <> [2016-06-14 09:12:17 -0700]:
>>> I haven't did a full test as the functions I modified are not 
>>> actually being
>>> used.
>>> It is a bare-metal environment, using clang to compile.
>>> Main flags are -mcpu=cortex-m3 -Os -fdata-sections -ffunction-sections
>>> -mno-unaligned-access
>>> Could you please let me know the gas option?
>> -mimplicit-it=always
>>> Thanks,
>>> Weiing
>>> On 6/14/2016 6:00 AM, Rich Felker wrote:
>>>> On Tue, Jun 14, 2016 at 01:49:40AM -0700, 
>>>> wrote:
>>>>> Hi,
>>>>> I'm building MUSL with -mcpu=cortex-m3. There are a few .s files
>>>>> that cannot be assembled because: (1) use predicated instructions
>>>>> without IT instr (2) use sp inside reg list in ldmia/stmia.
>>>>> Please help to review the attached patch.
>>>> Did you test anything? These patches do not result in working code;
>>>> they just make it assemble without errors. There's already a gas
>>>> option to automatically add IT instructions where needed for
>>>> thumb-only targets, but that's not the only thing needed to support
>>>> thumb-only/cortex-m. I'd be interested in knowing more about the setup
>>>> you're trying to target. Is it Linux or bare-metal? If Linux, are you
>>>> going to use the ARM/FDPIC toolchain & kernel mods? I'm about to leave
>>>> at the moment but I'll follow up with a more detailed review of your
>>>> patch later.
>>>>> Also, is there any easy way of disabling string/arm/memcpy_le.S ?
>>>>> For baremetal, unaligned access may be unavailable.
>>>> That file does not perform any unaligned access. It should work on any
>>>> EABI-supported version of the arm instruction set.
>>>> Rich
>>> -- 
>>> Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, 
>>> hosted by The Linux Foundation

Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted by The Linux Foundation

View attachment "cortex_m3.patch" of type "text/plain" (2137 bytes)

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.