You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@mynewt.apache.org by Sterling Hughes <st...@apache.org> on 2017/01/10 17:45:18 UTC

macOS Sierra Support

Hi,

On the latest develop with the latest macOS Sierra and homebrew, If I 
have a target:

targets/slim_slinky
     app=apps/slinky
     bsp=hw/bsp/native
     build_profile=debug

(used to be optimized :-)

And I try and build:

$ newt run slim_slinky
Error: In file included from 
/usr/local/Cellar/gcc5/5.4.0/lib/gcc/5/gcc/x86_64-apple-darwin15.0.0/5.4.0/include-fixed/syslimits.h:7:0,
                  from 
/usr/local/Cellar/gcc5/5.4.0/lib/gcc/5/gcc/x86_64-apple-darwin15.0.0/5.4.0/include-fixed/limits.h:34,
                  from encoding/tinycbor/include/tinycbor/cbor.h:29,
                  from mgmt/newtmgr/include/newtmgr/newtmgr.h:23,
                  from apps/slinky/src/main.c:37:
/usr/local/Cellar/gcc5/5.4.0/lib/gcc/5/gcc/x86_64-apple-darwin15.0.0/5.4.0/include-fixed/limits.h:168:61: 
error: no include path in which to search for limits.h

I get beyond this by compiling out gcc-5, and instead using the native 
Mac LLVM compiler (fixes in dev to make the system work with that).  
However, the next issue is gdb:

$ newt run slim_slinky
<snip>
[/Users/sterling/dev/mynewt/core/hw/bsp/native/native_debug.sh 
/Users/sterling/dev/mynewt/core/hw/bsp/native 
/Users/sterling/dev/mynewt/core/bin/targets/slim_slinky/app/apps/slinky/slinky]
Debugging 
/Users/sterling/dev/mynewt/core/bin/targets/slim_slinky/app/apps/slinky/slinky.elf
<snip>
Reading symbols from 
/Users/sterling/dev/mynewt/core/bin/targets/slim_slinky/app/apps/slinky/slinky.elf...done.
(gdb) c
The program is not being run.
(gdb) r
Starting program: 
/Users/sterling/dev/mynewt/core/bin/targets/slim_slinky/app/apps/slinky/slinky.elf
During startup program terminated with signal ?, Unknown signal.
(gdb)

If I switch to using llvm debugger, I can debug the system.  Which is 
fine, but I do generally prefer gdb due to familiarity.  Still, for 
those searching for a quick solution, lldb is fine.

Has anyone had success making these work on the latest macOS sierra.  My 
toolchain information:

$ gdb --version
GNU gdb (GDB) 7.12
Copyright (C) 2016 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later 
<http://gnu.org/licenses/gpl.html>
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 "x86_64-apple-darwin15.6.0".
$ gcc-5 --version
gcc-5 (Homebrew gcc5 5.4.0) 5.4.0
Copyright (C) 2015 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is 
NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR 
PURPOSE.

Attached is a patch that made things work with llvm.

Sterling

Re: macOS Sierra Support

Posted by Fabio Utzig <ut...@utzig.org>.
If no "brew cleanup" was run, you can always "brew switch" to another
version.

On Tue, Jan 10, 2017, at 04:00 PM, David G. Simmons wrote:
> Oh, yeah, because then it updates your gcc toolchain, and then all hell
> breaks loose. There is a way to back one update out. I think I documented
> that somewhere ... but essentially downgrade to gcc-5 in Homebrew. 
> 
> dg
> 
> > On Jan 10, 2017, at 12:57 PM, Sterling Hughes <st...@apache.org> wrote:
> > 
> > don’t do brew update/brew upgrade (or maybe use homebrew. :-)
> 
> --
> David G. Simmons
> (919) 534-5099
> Web <https://davidgs.com/> • Blog <https://davidgs.com/davidgs_blog> •
> Linkedin <http://linkedin.com/in/davidgsimmons> • Twitter
> <http://twitter.com/TechEvangelist1> • GitHub <http://github.com/davidgs>
> /** Message digitally signed for security and authenticity.  
> * If you cannot read the PGP.sig attachment, please go to 
>  * http://www.gnupg.com/ <http://www.gnupg.com/> Secure your email!!!
>  * Public key available at keyserver.pgp.com <http://keyserver.pgp.com/>
> **/
> ♺ This email uses 100% recycled electrons. Don't blow it by printing!
> 
> There are only 2 hard things in computer science: Cache invalidation,
> naming things, and off-by-one errors.
> 
> 

Re: macOS Sierra Support

Posted by "David G. Simmons" <sa...@mac.com>.
Oh, yeah, because then it updates your gcc toolchain, and then all hell breaks loose. There is a way to back one update out. I think I documented that somewhere ... but essentially downgrade to gcc-5 in Homebrew. 

dg

> On Jan 10, 2017, at 12:57 PM, Sterling Hughes <st...@apache.org> wrote:
> 
> don’t do brew update/brew upgrade (or maybe use homebrew. :-)

--
David G. Simmons
(919) 534-5099
Web <https://davidgs.com/> • Blog <https://davidgs.com/davidgs_blog> • Linkedin <http://linkedin.com/in/davidgsimmons> • Twitter <http://twitter.com/TechEvangelist1> • GitHub <http://github.com/davidgs>
/** Message digitally signed for security and authenticity.  
* If you cannot read the PGP.sig attachment, please go to 
 * http://www.gnupg.com/ <http://www.gnupg.com/> Secure your email!!!
 * Public key available at keyserver.pgp.com <http://keyserver.pgp.com/>
**/
♺ This email uses 100% recycled electrons. Don't blow it by printing!

There are only 2 hard things in computer science: Cache invalidation, naming things, and off-by-one errors.



Re: macOS Sierra Support

Posted by Sterling Hughes <st...@apache.org>.
don’t do brew update/brew upgrade (or maybe use homebrew. :-)

On 10 Jan 2017, at 9:53, David G. Simmons wrote:

> I'm running the latest Sierra without issue ...
> DSimmons-Pro:myproj dsimmons$ newt -v build air_q
> Building target targets/air_q
> Loading compiler 
> /Users/dsimmons/dev/myproj/repos/apache-mynewt-core/compiler/arm-none-eabi-m4, 
> def debug
> Compiling src in base directory: 
> /Users/dsimmons/dev/myproj/bin/targets/air_q/generated/src
> Loading compiler 
> /Users/dsimmons/dev/myproj/repos/apache-mynewt-core/compiler/arm-none-eabi-m4, 
> def debug
> Compiling src in base directory: 
> /Users/dsimmons/dev/myproj/apps/air_quality/src
> ...
> DSimmons-Pro:apache-mynewt-core dsimmons$ gdb --version
> GNU gdb (GDB) 7.11.1
> Copyright (C) 2016 Free Software Foundation, Inc.
> License GPLv3+: GNU GPL version 3 or later 
> <http://gnu.org/licenses/gpl.html>
> 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 "x86_64-apple-darwin15.5.0".
> Type "show configuration" for configuration details.
> For bug reporting instructions, please see:
> <http://www.gnu.org/software/gdb/bugs/>.
> Find the GDB manual and other documentation resources online at:
> <http://www.gnu.org/software/gdb/documentation/>.
> For help, type "help".
> Type "apropos word" to search for commands related to "word".
> DSimmons-Pro:apache-mynewt-core dsimmons$
>
>
> MacOS Sierra v10.12.2 (16C67)
>
> dg
>> On Jan 10, 2017, at 12:45 PM, Sterling Hughes <st...@apache.org> 
>> wrote:
>>
>> Hi,
>>
>> On the latest develop with the latest macOS Sierra and homebrew, If I 
>> have a target:
>>
>> targets/slim_slinky
>>    app=apps/slinky
>>    bsp=hw/bsp/native
>>    build_profile=debug
>>
>> (used to be optimized :-)
>>
>> And I try and build:
>>
>> $ newt run slim_slinky
>> Error: In file included from 
>> /usr/local/Cellar/gcc5/5.4.0/lib/gcc/5/gcc/x86_64-apple-darwin15.0.0/5.4.0/include-fixed/syslimits.h:7:0,
>>                 from 
>> /usr/local/Cellar/gcc5/5.4.0/lib/gcc/5/gcc/x86_64-apple-darwin15.0.0/5.4.0/include-fixed/limits.h:34,
>>                 from encoding/tinycbor/include/tinycbor/cbor.h:29,
>>                 from mgmt/newtmgr/include/newtmgr/newtmgr.h:23,
>>                 from apps/slinky/src/main.c:37:
>> /usr/local/Cellar/gcc5/5.4.0/lib/gcc/5/gcc/x86_64-apple-darwin15.0.0/5.4.0/include-fixed/limits.h:168:61: 
>> error: no include path in which to search for limits.h
>>
>> I get beyond this by compiling out gcc-5, and instead using the 
>> native Mac LLVM compiler (fixes in dev to make the system work with 
>> that).  However, the next issue is gdb:
>>
>> $ newt run slim_slinky
>> <snip>
>> [/Users/sterling/dev/mynewt/core/hw/bsp/native/native_debug.sh 
>> /Users/sterling/dev/mynewt/core/hw/bsp/native 
>> /Users/sterling/dev/mynewt/core/bin/targets/slim_slinky/app/apps/slinky/slinky]
>> Debugging 
>> /Users/sterling/dev/mynewt/core/bin/targets/slim_slinky/app/apps/slinky/slinky.elf
>> <snip>
>> Reading symbols from 
>> /Users/sterling/dev/mynewt/core/bin/targets/slim_slinky/app/apps/slinky/slinky.elf...done.
>> (gdb) c
>> The program is not being run.
>> (gdb) r
>> Starting program: 
>> /Users/sterling/dev/mynewt/core/bin/targets/slim_slinky/app/apps/slinky/slinky.elf
>> During startup program terminated with signal ?, Unknown signal.
>> (gdb)
>>
>> If I switch to using llvm debugger, I can debug the system.  Which is 
>> fine, but I do generally prefer gdb due to familiarity.  Still, for 
>> those searching for a quick solution, lldb is fine.
>>
>> Has anyone had success making these work on the latest macOS sierra.  
>> My toolchain information:
>>
>> $ gdb --version
>> GNU gdb (GDB) 7.12
>> Copyright (C) 2016 Free Software Foundation, Inc.
>> License GPLv3+: GNU GPL version 3 or later 
>> <http://gnu.org/licenses/gpl.html>
>> 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 "x86_64-apple-darwin15.6.0".
>> $ gcc-5 --version
>> gcc-5 (Homebrew gcc5 5.4.0) 5.4.0
>> Copyright (C) 2015 Free Software Foundation, Inc.
>> This is free software; see the source for copying conditions.  There 
>> is NO
>> warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR 
>> PURPOSE.
>>
>> Attached is a patch that made things work with llvm.
>>
>> Sterling<patch-use-native-llvm-macos.txt>
>
> --
> David G. Simmons
> (919) 534-5099
> Web <https://davidgs.com/> • Blog <https://davidgs.com/davidgs_blog> 
> • Linkedin <http://linkedin.com/in/davidgsimmons> • Twitter 
> <http://twitter.com/TechEvangelist1> • GitHub 
> <http://github.com/davidgs>
> /** Message digitally signed for security and authenticity.
> * If you cannot read the PGP.sig attachment, please go to
>  * http://www.gnupg.com/ <http://www.gnupg.com/> Secure your email!!!
>  * Public key available at keyserver.pgp.com 
> <http://keyserver.pgp.com/>
> **/
> ♺ This email uses 100% recycled electrons. Don't blow it by 
> printing!
>
> There are only 2 hard things in computer science: Cache invalidation, 
> naming things, and off-by-one errors.

Re: macOS Sierra Support

Posted by Peter Snyder <pe...@peterfs.net>.
There were two things I needed to do to get GDB to work. You need the latest GDB (which it looks like you have) and then codesign the binary. Even though it refers to an older version of MacOS, I found the following instructions under 2.1 in this webpage helpful: https://sourceware.org/gdb/wiki/BuildingOnDarwin <https://sourceware.org/gdb/wiki/BuildingOnDarwin>

Also, you need to add this to your ~/.gdbinit file:
set startup-with-shell off

I had issues runniing GDB and these two things solved them. One caveat however, apparently quitting GDB leaves zombie process around - these appear benign as they aren’t holding any resources, but it is disconcerting.

- peter


> On Jan 10, 2017, at 9:53 AM, David G. Simmons <sa...@mac.com> wrote:
> 
> I'm running the latest Sierra without issue ... 
> DSimmons-Pro:myproj dsimmons$ newt -v build air_q
> Building target targets/air_q
> Loading compiler /Users/dsimmons/dev/myproj/repos/apache-mynewt-core/compiler/arm-none-eabi-m4, def debug
> Compiling src in base directory: /Users/dsimmons/dev/myproj/bin/targets/air_q/generated/src
> Loading compiler /Users/dsimmons/dev/myproj/repos/apache-mynewt-core/compiler/arm-none-eabi-m4, def debug
> Compiling src in base directory: /Users/dsimmons/dev/myproj/apps/air_quality/src
> ...
> DSimmons-Pro:apache-mynewt-core dsimmons$ gdb --version
> GNU gdb (GDB) 7.11.1
> Copyright (C) 2016 Free Software Foundation, Inc.
> License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
> 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 "x86_64-apple-darwin15.5.0".
> Type "show configuration" for configuration details.
> For bug reporting instructions, please see:
> <http://www.gnu.org/software/gdb/bugs/>.
> Find the GDB manual and other documentation resources online at:
> <http://www.gnu.org/software/gdb/documentation/>.
> For help, type "help".
> Type "apropos word" to search for commands related to "word".
> DSimmons-Pro:apache-mynewt-core dsimmons$
> 
> 
> MacOS Sierra v10.12.2 (16C67)
> 
> dg
>> On Jan 10, 2017, at 12:45 PM, Sterling Hughes <st...@apache.org> wrote:
>> 
>> Hi,
>> 
>> On the latest develop with the latest macOS Sierra and homebrew, If I have a target:
>> 
>> targets/slim_slinky
>>   app=apps/slinky
>>   bsp=hw/bsp/native
>>   build_profile=debug
>> 
>> (used to be optimized :-)
>> 
>> And I try and build:
>> 
>> $ newt run slim_slinky
>> Error: In file included from /usr/local/Cellar/gcc5/5.4.0/lib/gcc/5/gcc/x86_64-apple-darwin15.0.0/5.4.0/include-fixed/syslimits.h:7:0,
>>                from /usr/local/Cellar/gcc5/5.4.0/lib/gcc/5/gcc/x86_64-apple-darwin15.0.0/5.4.0/include-fixed/limits.h:34,
>>                from encoding/tinycbor/include/tinycbor/cbor.h:29,
>>                from mgmt/newtmgr/include/newtmgr/newtmgr.h:23,
>>                from apps/slinky/src/main.c:37:
>> /usr/local/Cellar/gcc5/5.4.0/lib/gcc/5/gcc/x86_64-apple-darwin15.0.0/5.4.0/include-fixed/limits.h:168:61: error: no include path in which to search for limits.h
>> 
>> I get beyond this by compiling out gcc-5, and instead using the native Mac LLVM compiler (fixes in dev to make the system work with that).  However, the next issue is gdb:
>> 
>> $ newt run slim_slinky
>> <snip>
>> [/Users/sterling/dev/mynewt/core/hw/bsp/native/native_debug.sh /Users/sterling/dev/mynewt/core/hw/bsp/native /Users/sterling/dev/mynewt/core/bin/targets/slim_slinky/app/apps/slinky/slinky]
>> Debugging /Users/sterling/dev/mynewt/core/bin/targets/slim_slinky/app/apps/slinky/slinky.elf
>> <snip>
>> Reading symbols from /Users/sterling/dev/mynewt/core/bin/targets/slim_slinky/app/apps/slinky/slinky.elf...done.
>> (gdb) c
>> The program is not being run.
>> (gdb) r
>> Starting program: /Users/sterling/dev/mynewt/core/bin/targets/slim_slinky/app/apps/slinky/slinky.elf
>> During startup program terminated with signal ?, Unknown signal.
>> (gdb)
>> 
>> If I switch to using llvm debugger, I can debug the system.  Which is fine, but I do generally prefer gdb due to familiarity.  Still, for those searching for a quick solution, lldb is fine.
>> 
>> Has anyone had success making these work on the latest macOS sierra.  My toolchain information:
>> 
>> $ gdb --version
>> GNU gdb (GDB) 7.12
>> Copyright (C) 2016 Free Software Foundation, Inc.
>> License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
>> 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 "x86_64-apple-darwin15.6.0".
>> $ gcc-5 --version
>> gcc-5 (Homebrew gcc5 5.4.0) 5.4.0
>> Copyright (C) 2015 Free Software Foundation, Inc.
>> This is free software; see the source for copying conditions.  There is NO
>> warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
>> 
>> Attached is a patch that made things work with llvm.
>> 
>> Sterling<patch-use-native-llvm-macos.txt>
> 
> --
> David G. Simmons
> (919) 534-5099
> Web <https://davidgs.com/> • Blog <https://davidgs.com/davidgs_blog> • Linkedin <http://linkedin.com/in/davidgsimmons> • Twitter <http://twitter.com/TechEvangelist1> • GitHub <http://github.com/davidgs>
> /** Message digitally signed for security and authenticity.  
> * If you cannot read the PGP.sig attachment, please go to 
> * http://www.gnupg.com/ <http://www.gnupg.com/> Secure your email!!!
> * Public key available at keyserver.pgp.com <http://keyserver.pgp.com/>
> **/
> ♺ This email uses 100% recycled electrons. Don't blow it by printing!
> 
> There are only 2 hard things in computer science: Cache invalidation, naming things, and off-by-one errors.
> 
> 


Re: macOS Sierra Support

Posted by "David G. Simmons" <sa...@mac.com>.
I'm running the latest Sierra without issue ... 
DSimmons-Pro:myproj dsimmons$ newt -v build air_q
Building target targets/air_q
Loading compiler /Users/dsimmons/dev/myproj/repos/apache-mynewt-core/compiler/arm-none-eabi-m4, def debug
Compiling src in base directory: /Users/dsimmons/dev/myproj/bin/targets/air_q/generated/src
Loading compiler /Users/dsimmons/dev/myproj/repos/apache-mynewt-core/compiler/arm-none-eabi-m4, def debug
Compiling src in base directory: /Users/dsimmons/dev/myproj/apps/air_quality/src
...
DSimmons-Pro:apache-mynewt-core dsimmons$ gdb --version
GNU gdb (GDB) 7.11.1
Copyright (C) 2016 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
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 "x86_64-apple-darwin15.5.0".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word".
DSimmons-Pro:apache-mynewt-core dsimmons$


MacOS Sierra v10.12.2 (16C67)

dg
> On Jan 10, 2017, at 12:45 PM, Sterling Hughes <st...@apache.org> wrote:
> 
> Hi,
> 
> On the latest develop with the latest macOS Sierra and homebrew, If I have a target:
> 
> targets/slim_slinky
>    app=apps/slinky
>    bsp=hw/bsp/native
>    build_profile=debug
> 
> (used to be optimized :-)
> 
> And I try and build:
> 
> $ newt run slim_slinky
> Error: In file included from /usr/local/Cellar/gcc5/5.4.0/lib/gcc/5/gcc/x86_64-apple-darwin15.0.0/5.4.0/include-fixed/syslimits.h:7:0,
>                 from /usr/local/Cellar/gcc5/5.4.0/lib/gcc/5/gcc/x86_64-apple-darwin15.0.0/5.4.0/include-fixed/limits.h:34,
>                 from encoding/tinycbor/include/tinycbor/cbor.h:29,
>                 from mgmt/newtmgr/include/newtmgr/newtmgr.h:23,
>                 from apps/slinky/src/main.c:37:
> /usr/local/Cellar/gcc5/5.4.0/lib/gcc/5/gcc/x86_64-apple-darwin15.0.0/5.4.0/include-fixed/limits.h:168:61: error: no include path in which to search for limits.h
> 
> I get beyond this by compiling out gcc-5, and instead using the native Mac LLVM compiler (fixes in dev to make the system work with that).  However, the next issue is gdb:
> 
> $ newt run slim_slinky
> <snip>
> [/Users/sterling/dev/mynewt/core/hw/bsp/native/native_debug.sh /Users/sterling/dev/mynewt/core/hw/bsp/native /Users/sterling/dev/mynewt/core/bin/targets/slim_slinky/app/apps/slinky/slinky]
> Debugging /Users/sterling/dev/mynewt/core/bin/targets/slim_slinky/app/apps/slinky/slinky.elf
> <snip>
> Reading symbols from /Users/sterling/dev/mynewt/core/bin/targets/slim_slinky/app/apps/slinky/slinky.elf...done.
> (gdb) c
> The program is not being run.
> (gdb) r
> Starting program: /Users/sterling/dev/mynewt/core/bin/targets/slim_slinky/app/apps/slinky/slinky.elf
> During startup program terminated with signal ?, Unknown signal.
> (gdb)
> 
> If I switch to using llvm debugger, I can debug the system.  Which is fine, but I do generally prefer gdb due to familiarity.  Still, for those searching for a quick solution, lldb is fine.
> 
> Has anyone had success making these work on the latest macOS sierra.  My toolchain information:
> 
> $ gdb --version
> GNU gdb (GDB) 7.12
> Copyright (C) 2016 Free Software Foundation, Inc.
> License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
> 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 "x86_64-apple-darwin15.6.0".
> $ gcc-5 --version
> gcc-5 (Homebrew gcc5 5.4.0) 5.4.0
> Copyright (C) 2015 Free Software Foundation, Inc.
> This is free software; see the source for copying conditions.  There is NO
> warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
> 
> Attached is a patch that made things work with llvm.
> 
> Sterling<patch-use-native-llvm-macos.txt>

--
David G. Simmons
(919) 534-5099
Web <https://davidgs.com/> • Blog <https://davidgs.com/davidgs_blog> • Linkedin <http://linkedin.com/in/davidgsimmons> • Twitter <http://twitter.com/TechEvangelist1> • GitHub <http://github.com/davidgs>
/** Message digitally signed for security and authenticity.  
* If you cannot read the PGP.sig attachment, please go to 
 * http://www.gnupg.com/ <http://www.gnupg.com/> Secure your email!!!
 * Public key available at keyserver.pgp.com <http://keyserver.pgp.com/>
**/
♺ This email uses 100% recycled electrons. Don't blow it by printing!

There are only 2 hard things in computer science: Cache invalidation, naming things, and off-by-one errors.