Skip to content
This repository has been archived by the owner on Feb 8, 2024. It is now read-only.

Unrecognized option: --distinct_host_configuration=false #34

Open
ajtalbot1 opened this issue Feb 3, 2024 · 1 comment
Open

Unrecognized option: --distinct_host_configuration=false #34

ajtalbot1 opened this issue Feb 3, 2024 · 1 comment

Comments

@ajtalbot1
Copy link

ajtalbot1 commented Feb 3, 2024

Clean install of Ubuntu 23.04, installed bazel from apt.

root@Workspace:~# bazel version
Build label: 7.0.2
.....

root@Workspace:~# mkdir workspace && cd workspace/
root@Workspace:~/workspace# git clone --recursive  https://github.com/mihaigalos/miniboot.gitcd && cd miniboot/

root@Workspace:~/workspace/miniboot# bazel build --config=328p --verbose_failures //:miniboot.elf
Starting local Bazel server and connecting to it...
INFO: Found applicable config definition build:328p in file /root/workspace/miniboot/.bazelrc: --crosstool_top=@avr_tools//tools/avr:toolchain_avr --distinct_host_configuration=false --cpu=avr --define MCU=atmega328p
ERROR: --distinct_host_configuration=false :: Unrecognized option: --distinct_host_configuration=false

root@Workspace:~/workspace/miniboot# vi .bazelrc
# Removed --distinct_host_configuration=false

root@Workspace:~/workspace/miniboot# bazel build --config=328p --verbose_failures //:miniboot.elf
WARNING: --enable_bzlmod is set, but no MODULE.bazel file was found at the workspace root. Bazel will create an empty MODULE.bazel file. Please consider migrating your external dependencies from WORKSPACE to MODULE.bazel. For more details, please refer to https://github.com/bazelbuild/bazel/issues/18958.
INFO: Analyzed target //:miniboot.elf (69 packages loaded, 319 targets configured).
ERROR: /root/workspace/miniboot/BUILD:51:10: Compiling src/miniboot.cpp failed: (Exit 1): gcc failed: error executing CppCompile command (from target //:miniboot.elf)
  (cd /root/.cache/bazel/_bazel_root/c2d1d1fca9699ae911e5d72b4f92e7cf/sandbox/processwrapper-sandbox/3/execroot/_main && \
  exec env - \
    PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin \
    PWD=/proc/self/cwd \
  /usr/bin/gcc -U_FORTIFY_SOURCE -fstack-protector -Wall -Wunused-but-set-parameter -Wno-free-nonheap-object -fno-omit-frame-pointer '-std=c++14' -MD -MF bazel-out/avr-fastbuild/bin/_objs/miniboot.elf/miniboot.pic.d '-frandom-seed=bazel-out/avr-fastbuild/bin/_objs/miniboot.elf/miniboot.pic.o' -fPIC -iquote . -iquote bazel-out/avr-fastbuild/bin -iquote external/avr-bootloader-common -iquote bazel-out/avr-fastbuild/bin/external/avr-bootloader-common -iquote external/bazel_tools -iquote bazel-out/avr-fastbuild/bin/external/bazel_tools -Ibazel-out/avr-fastbuild/bin/external/avr-bootloader-common/_virtual_includes/avr-bootloader-common -isystem src -isystem bazel-out/avr-fastbuild/bin/src -isystem external/avr-bootloader-common/include -isystem bazel-out/avr-fastbuild/bin/external/avr-bootloader-common/include '-DF_CPU=8000000UL' -fdiagnostics-color -fpack-struct -fshort-enums -funsigned-bitfields -funsigned-char -g -lm '-Wl,--relax,--gc-sections,-Map=miniboot.map' '-Wl,--section-start=.text=0x7800' '-mmcu=atmega328p' -Os -pedantic '-std=gnu++14' -Wall -Werror '-Wl,-Map=miniboot.map,--cref' -fno-canonical-system-headers -Wno-builtin-macro-redefined '-D__DATE__="redacted"' '-D__TIMESTAMP__="redacted"' '-D__TIME__="redacted"' -c src/miniboot.cpp -o bazel-out/avr-fastbuild/bin/_objs/miniboot.elf/miniboot.pic.o)
# Configuration: 5c091e33c4f4cae2263b72c5ad9270f33c6128367db4ddf13c8a3fe28c525286
# Execution platform: @@local_config_platform//:host

Use --sandbox_debug to see verbose messages from the sandbox and retain the sandbox build root for debugging
gcc: error: unrecognized command-line option '-mmcu=atmega328p'
ERROR: /root/workspace/miniboot/BUILD:51:10: Compiling src/i2c_master.cpp failed: (Exit 1): gcc failed: error executing CppCompile command (from target //:miniboot.elf)
  (cd /root/.cache/bazel/_bazel_root/c2d1d1fca9699ae911e5d72b4f92e7cf/sandbox/processwrapper-sandbox/2/execroot/_main && \
  exec env - \
    PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin \
    PWD=/proc/self/cwd \
  /usr/bin/gcc -U_FORTIFY_SOURCE -fstack-protector -Wall -Wunused-but-set-parameter -Wno-free-nonheap-object -fno-omit-frame-pointer '-std=c++14' -MD -MF bazel-out/avr-fastbuild/bin/_objs/miniboot.elf/i2c_master.pic.d '-frandom-seed=bazel-out/avr-fastbuild/bin/_objs/miniboot.elf/i2c_master.pic.o' -fPIC -iquote . -iquote bazel-out/avr-fastbuild/bin -iquote external/avr-bootloader-common -iquote bazel-out/avr-fastbuild/bin/external/avr-bootloader-common -iquote external/bazel_tools -iquote bazel-out/avr-fastbuild/bin/external/bazel_tools -Ibazel-out/avr-fastbuild/bin/external/avr-bootloader-common/_virtual_includes/avr-bootloader-common -isystem src -isystem bazel-out/avr-fastbuild/bin/src -isystem external/avr-bootloader-common/include -isystem bazel-out/avr-fastbuild/bin/external/avr-bootloader-common/include '-DF_CPU=8000000UL' -fdiagnostics-color -fpack-struct -fshort-enums -funsigned-bitfields -funsigned-char -g -lm '-Wl,--relax,--gc-sections,-Map=miniboot.map' '-Wl,--section-start=.text=0x7800' '-mmcu=atmega328p' -Os -pedantic '-std=gnu++14' -Wall -Werror '-Wl,-Map=miniboot.map,--cref' -fno-canonical-system-headers -Wno-builtin-macro-redefined '-D__DATE__="redacted"' '-D__TIMESTAMP__="redacted"' '-D__TIME__="redacted"' -c src/i2c_master.cpp -o bazel-out/avr-fastbuild/bin/_objs/miniboot.elf/i2c_master.pic.o)
# Configuration: 5c091e33c4f4cae2263b72c5ad9270f33c6128367db4ddf13c8a3fe28c525286
# Execution platform: @@local_config_platform//:host

Use --sandbox_debug to see verbose messages from the sandbox and retain the sandbox build root for debugging
gcc: error: unrecognized command-line option '-mmcu=atmega328p'
Target //:miniboot.elf failed to build
INFO: Elapsed time: 3.074s, Critical Path: 0.05s
INFO: 5 processes: 4 internal, 1 processwrapper-sandbox.
ERROR: Build did NOT complete successfully

I am stuck. Any help would be appreciated.
-Adam

@mihaigalos
Copy link
Owner

Hi Adam,

If you just want to run miniboot without modifying it, you can flash the hex file in the bin folder.

I'll have to dive deeper into your problem to be able to reproduce it.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants