macOS: use homebrew gcc using version suffix. update setup instructions (#1409)

* Add version suffix to gcc on Darwin

* Update macos setup intructions

* Delete unused SConscript at tests/

* Move gcc stuff to tests/libpanda/SConscript
This commit is contained in:
Kacper Rączy
2023-05-12 11:06:08 -07:00
committed by GitHub
parent 3d4b7b1afc
commit 822a7367c1
2 changed files with 14 additions and 4 deletions

View File

@@ -20,8 +20,8 @@ sudo apt-get install dfu-util gcc-arm-none-eabi python3-pip libffi-dev git
```
```bash
# macOS
brew tap ArmMbed/homebrew-formulae
brew install python dfu-util arm-none-eabi-gcc gcc@12
brew install --cask gcc-arm-embedded
brew install python3 dfu-util gcc@12
```
Clone panda repository:

View File

@@ -1,5 +1,14 @@
import platform
CC = 'gcc'
system = platform.system()
if system == 'Darwin':
# gcc installed by homebrew has version suffix (e.g. gcc-12) in order to be
# distinguishable from system one - which acts as a symlink to clang
CC += '-12'
env = Environment(
CC='gcc',
CC=CC,
CFLAGS=[
'-nostdlib',
'-fno-builtin',
@@ -8,7 +17,8 @@ env = Environment(
],
CPPPATH=[".", "../../board/"],
)
env.PrependENVPath('PATH', '/opt/homebrew/bin')
if system == "Darwin":
env.PrependENVPath('PATH', '/opt/homebrew/bin')
if GetOption('ubsan'):
flags = [