You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@mynewt.apache.org by amit mehta <gm...@gmail.com> on 2017/03/04 22:13:46 UTC

Re: Can't build blinky app on macOS Sierra

On Fri, Feb 10, 2017 at 3:58 AM, marko kiiskila <ma...@runtime.io> wrote:
> Hi Denis,
>
> I think Chris meant output of ‘newt -ldebug build my_blinky_sim’
>
> What looks confusing is the the contents of build_log.rtf.
> It looks as if the file in question was getting processed twice:
> First with gcc-6, and then with clang. And it’s the second invocation that’s
> causing this error.
>
> Obviously, only the first step should take place. So there’s possibly
> something funky going on with newt. But I don’t know what could
> cause this kind of error. Can you double-check the go version
> you’re using?
>
> Also, could you try with the latest beta2 (close to being released)?
>
> cd $GOPATH/src/newt/mynewt.apache.org/newt
> git checkout mynewt_1_0_0_b2_rc1_tag
> cd newt
> go build; go install
>
> And then go through the project creation part again.
>
>
>> On Feb 9, 2017, at 5:40 PM, Denis Magda <dm...@apache.org> wrote:
>>
>> Hi Chris,
>>
>> Please find requested data attached here:
>> https://drive.google.com/open?id=0B0qn42TRMz5EV1JobzBqM1loa3c <https://drive.google.com/open?id=0B0qn42TRMz5EV1JobzBqM1loa3c>
>>
>> As for “-ldebug” it has no effect for me. Tried to add it to many parameters from compiler.yml with no success.
>> However, “-v” command generated verbose output at the time the compilation of the assembly file failed.
>>
>> —
>> Denis
>>
>>
>>> On Feb 9, 2017, at 8:48 AM, Christopher Collins <cc...@apache.org> wrote:
>>>
>>> Hi Denis,
>>>
>>> On Wed, Feb 08, 2017 at 09:39:10PM -0800, Denis Magda wrote:
>>>> Hello Mynewt community,
>>>>
>>>> I tried to play with your product strictly following the getting started guide [1] but can’t compile the default blinky app
>>>>
>>>> Deniss-MBP:test dmagda$ newt build my_blinky_sim
>>>> Building target targets/my_blinky_sim
>>>> Assembling os_arch_stack_frame.s
>>>> Error: os_arch_stack_frame.s:34:17: error: unexpected token in directive
>>>>   .globl CNAME(os_arch_frame_init)
>>>>               ^
>>>> os_arch_stack_frame.s:39:26: error: unexpected token in argument list
>>>> CNAME(os_arch_frame_init):
>>>>                        ^
>>>> os_arch_stack_frame.s:84:19: error: unexpected token in memory operand
>>>>   call    CNAME(sigsetjmp)        /* sigsetjmp(sf->sf_jb, 0) */
>>>>                 ^
>>>> os_arch_stack_frame.s:98:19: error: unexpected token in memory operand
>>>>   call    CNAME(os_arch_task_start) /* os_arch_task_start(sf, rc) */
>>>
>>> Hmm, that's odd.  I don't have any theories, but I'll look into it.
>>> Could you please post the following:
>>>
>>> * Contents of compiler/sim/compiler.yml
>>> * Output of "gcc-6 -v" (or whatever your gcc binary is called)
>>>
>>> Another option that could be helpful is to try building with the
>>> "-ldebug" command line switch.  This will enable a lot of debug output,
>>> including the actual command used to assemble that .s file.
>>>
>>> Thanks,
>>> Chris
>>>
>>>
>>>>
>>>>
>>>> The dev environment is the following:
>>>> * macOS Sierra
>>>> * newt, gcc and gdb are natively installed
>>>> - newt version: Apache Newt (incubating) version: 1.0.0-dev
>>>> - gcc version: gcc version 6.3.0 (Homebrew GCC 6.3.0_1)
>>>> * gcc-5 replaced with gcc-6 in compiler.yml according to this doc [2].
>>>>
>>>>
>>>> Am I missing something or doing something wrong?
>>>>
>>>> [1] https://mynewt.incubator.apache.org/os/get_started/project_create/
>>>> [2] https://mynewt.incubator.apache.org/os/get_started/native_tools/
>>>>
>>>> —
>>>> Denis
>>
>

Today, I faced this same problem on my Linux host. Good news was
that the suggested solution to use rc1 release worked in my case as well.
Please see the logs below:

setup: Native Linux (Fedora 23)
[amit@discworld newt]$ uname -a
Linux discworld 4.8.13-100.fc23.x86_64 #1 SMP Fri Dec 9 14:51:40 UTC
2016 x86_64 x86_64 x86_64 GNU/Linux

[amit@discworld myproj]$ gcc -v
Using built-in specs.
COLLECT_GCC=/usr/bin/gcc
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-redhat-linux/5.3.1/lto-wrapper
Target: x86_64-redhat-linux
Configured with: ../configure --enable-bootstrap
--enable-languages=c,c++,objc,obj-c++,fortran,ada,go,lto --prefix=/usr
--mandir=/usr/share/man --infodir=/usr/share/info
--with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-shared
--enable-threads=posix --enable-checking=release --enable-multilib
--with-system-zlib --enable-__cxa_atexit
--disable-libunwind-exceptions --enable-gnu-unique-object
--enable-linker-build-id --with-linker-hash-style=gnu --enable-plugin
--enable-initfini-array --disable-libgcj --with-isl --enable-libmpx
--enable-gnu-indirect-function --with-tune=generic --with-arch_32=i686
--build=x86_64-redhat-linux
Thread model: posix
gcc version 5.3.1 20160406 (Red Hat 5.3.1-6) (GCC)

[amit@discworld newt]$ pwd
/home/amit/dev/go/src/mynewt.apache.org/newt/newt

[amit@discworld newt]$ git branch
* master
[amit@discworld myproj]$ tail project.yml
    - apache-mynewt-core

# Use github's distribution mechanism for core ASF libraries.
# This provides mirroring automatically for us.
#
repository.apache-mynewt-core:
    type: github
    vers: 1-latest
    user: apache
    repo: incubator-mynewt-core

[amit@discworld myproj]$ newt clean all

[amit@discworld myproj]$ newt build my_blinky_sim
Building target targets/my_blinky_sim
Compiling main.c
Archiving blinky.a
Compiling hal_bsp.c
Compiling sbrk.c
Archiving native.a
Compiling uart.c
Archiving uart.a
Compiling uart_hal.c
Archiving uart_hal.a
Compiling hal_common.c
Compiling hal_flash.c
Archiving hal.a
Compiling hal_flash.c
Compiling hal_gpio.c
Compiling hal_hw_id.c
Compiling hal_reset_cause.c
Compiling hal_system.c
Compiling hal_timer.c
Compiling hal_uart.c
Compiling hal_watchdog.c
Archiving native.a
Compiling endian.c
Compiling os.c
Compiling os_callout.c
Compiling os_cputime.c
Compiling os_dev.c
Compiling os_eventq.c
Compiling os_heap.c
Compiling os_mbuf.c
Compiling os_mempool.c
Compiling os_msys_init.c
Compiling os_mutex.c
Compiling os_sanity.c
Compiling os_sched.c
Compiling os_sem.c
Compiling os_task.c
Compiling os_time.c
Compiling os_arch_sim.c
Compiling os_fault.c
Assembling os_arch_stack_frame.s
Error: os_arch_stack_frame.s: Assembler messages:
os_arch_stack_frame.s:34: Error: junk at end of line, first
unrecognized character is `('
os_arch_stack_frame.s:39: Error: invalid character '(' in mnemonic
os_arch_stack_frame.s:84: Error: junk `(sigsetjmp)' after expression
os_arch_stack_frame.s:98: Error: junk `(os_arch_task_start)' after expression

--------------NOW WITH THE SUGGESTED SOLUTION-------------
[amit@discworld newt]$ git checkout mynewt_1_0_0_b2_rc1_tag -b rc1
Switched to a new branch 'rc1'
[amit@discworld newt]$ git branch
  master
* rc1
[amit@discworld newt]$ pwd
/home/amit/dev/go/src/mynewt.apache.org/newt/newt
[amit@discworld newt]$ go build
[amit@discworld newt]$ go install

[amit@discworld myproj]$ pwd
/home/amit/Documents/devel/myproj

[amit@discworld myproj]$ newt clean all

[amit@discworld myproj]$ newt build my_blinky_sim
Building target targets/my_blinky_sim
Compiling repos/apache-mynewt-core/hw/drivers/uart/src/uart.c
Compiling repos/apache-mynewt-core/hw/bsp/native/src/sbrk.c
Compiling apps/blinky/src/main.c
Compiling repos/apache-mynewt-core/hw/drivers/uart/uart_hal/src/uart_hal.c
Compiling repos/apache-mynewt-core/hw/hal/src/hal_common.c
Compiling repos/apache-mynewt-core/hw/hal/src/hal_flash.c
Compiling repos/apache-mynewt-core/hw/bsp/native/src/hal_bsp.c
Compiling repos/apache-mynewt-core/hw/mcu/native/src/hal_gpio.c
Compiling repos/apache-mynewt-core/hw/mcu/native/src/hal_flash.c
Compiling repos/apache-mynewt-core/hw/mcu/native/src/hal_hw_id.c
Compiling repos/apache-mynewt-core/hw/mcu/native/src/hal_reset_cause.c
Compiling repos/apache-mynewt-core/hw/mcu/native/src/hal_watchdog.c
Compiling repos/apache-mynewt-core/hw/mcu/native/src/hal_timer.c
Compiling repos/apache-mynewt-core/hw/mcu/native/src/hal_system.c
Compiling repos/apache-mynewt-core/hw/mcu/native/src/hal_uart.c
Compiling repos/apache-mynewt-core/kernel/os/src/endian.c
Compiling repos/apache-mynewt-core/kernel/os/src/os.c
Compiling repos/apache-mynewt-core/kernel/os/src/os_callout.c
Compiling repos/apache-mynewt-core/kernel/os/src/os_cputime.c
Compiling repos/apache-mynewt-core/kernel/os/src/os_dev.c
Compiling repos/apache-mynewt-core/kernel/os/src/os_eventq.c
Compiling repos/apache-mynewt-core/kernel/os/src/os_heap.c
Compiling repos/apache-mynewt-core/kernel/os/src/os_mbuf.c
Compiling repos/apache-mynewt-core/kernel/os/src/os_msys_init.c
Compiling repos/apache-mynewt-core/kernel/os/src/os_mempool.c
Compiling repos/apache-mynewt-core/kernel/os/src/os_mutex.c
Compiling repos/apache-mynewt-core/kernel/os/src/os_sanity.c
Compiling repos/apache-mynewt-core/kernel/os/src/os_sem.c
Compiling repos/apache-mynewt-core/kernel/os/src/os_sched.c
Compiling repos/apache-mynewt-core/kernel/os/src/os_time.c
Compiling repos/apache-mynewt-core/kernel/os/src/os_task.c
Assembling repos/apache-mynewt-core/kernel/os/src/arch/sim/os_arch_stack_frame.s
Compiling repos/apache-mynewt-core/kernel/os/src/arch/sim/os_arch_sim.c
Compiling repos/apache-mynewt-core/kernel/os/src/arch/sim/os_fault.c
Compiling bin/targets/my_blinky_sim/generated/src/my_blinky_sim-sysflash.c
Compiling bin/targets/my_blinky_sim/generated/src/my_blinky_sim-sysinit-app.c
Compiling repos/apache-mynewt-core/net/ip/mn_socket/src/mn_socket_aconv.c
Compiling repos/apache-mynewt-core/net/ip/native_sockets/src/native_itf.c
Compiling repos/apache-mynewt-core/net/ip/mn_socket/src/mn_socket.c
Compiling repos/apache-mynewt-core/sys/console/full/src/prompt.c
Compiling repos/apache-mynewt-core/net/ip/native_sockets/src/native_sock.c
Compiling repos/apache-mynewt-core/sys/console/full/src/cons_fmt.c
Compiling repos/apache-mynewt-core/sys/console/full/src/ticks.c
Compiling repos/apache-mynewt-core/sys/console/full/src/cons_tty.c
Compiling repos/apache-mynewt-core/sys/flash_map/src/flash_map.c
Compiling repos/apache-mynewt-core/sys/sysinit/src/sysinit.c
Compiling repos/apache-mynewt-core/sys/mfg/src/mfg.c
Compiling repos/apache-mynewt-core/util/mem/src/mem.c
Archiving apps_blinky.a
Archiving hw_bsp_native.a
Archiving hw_drivers_uart.a
Archiving hw_drivers_uart_uart_hal.a
Archiving hw_hal.a
Archiving hw_mcu_native.a
Archiving kernel_os.a
Archiving my_blinky_sim-sysinit-app.a
Archiving net_ip_mn_socket.a
Archiving net_ip_native_sockets.a
Archiving sys_console_full.a
Archiving sys_flash_map.a
Archiving sys_mfg.a
Archiving sys_sysinit.a
Archiving util_mem.a
Linking /home/amit/Documents/devel/myproj/bin/targets/my_blinky_sim/app/apps/blinky/blinky.elf
Target successfully built: targets/my_blinky_sim <-- (builds fine)

[amit@discworld myproj]$ newt test @apache-mynewt-core/sys/config
Testing package @apache-mynewt-core/sys/config/test-nffs
Compiling repos/apache-mynewt-core/fs/fs/src/fs_cli.c
...
...
...
Passed tests: [sys/config/test-nffs sys/config/test-fcb]
All tests passed

Also, attached here is the full build log (-ldebug) for the failed build
on master branch.

Thanks,
Amit

-- 
Sent from Bahamas, while drinking chi-chi and piña colada.