Comments (3)
Hmm, I mustn't have defined the path for objcopy. So this is definitely a bug. However, I'd recommend using this workaround for now.
Here is how I use bazel-embedded to generate separate elfs/binaries.
The way that I do things is just to use the elf, or if I need the raw binary I just use the stripped target e.g. If I have the following build definition;
cc_binary(
name = "main",
srcs = ["main.cc"],
)
To get the elf file I run something like this (it won't have the .elf extension unless you name the cc_binary 'main.elf');
bazel build //:main --platforms=@bazel_embedded//platforms:cortex_m4_fpu
However, if I want the binary file I use the stripped
sub-target which is configured to strip all ELF sections leaving the binary e.g.
bazel build //:main.stripped --platforms=@bazel_embedded//platforms:cortex_m4_fpu
You can use strip or objcopy to achieve the same result in this case.
from bazel-embedded.
I think the main concern is keeping the build and debug symbols in the same step. If the binary is generated in a separate build step than the elf, there may be issues when going to debug via gdb. I'd rather have this copy step. I think fixing the definition here is probably the right way to do it. I'll see if I can submit a fix.
from bazel-embedded.
Yeah technically they are preserved e.g. it already looks like elf->stripped. So if you go elf(with embedded debug dwarf section)->stripped it'll still produce the same binary minus the elf headers and dwarf sections. But in any case that PR looks fine, and is fixing what I would consider a bug.
from bazel-embedded.
Related Issues (18)
- Add support for mac-osx and windows HOT 17
- Windows build does not include system headers HOT 7
- README doesn't mention openocd WORKSPACE requirements HOT 1
- Best approach for integrating a non-ARM toolchain HOT 2
- Dependency Dashboard
- SunCertPathBuilderException: unable to find valid certification path to requested target HOT 2
- Extensibility guidance - customizing build flags for various embedded platforms HOT 4
- Feature names are inverted
- Toolchain resolution seemingly failing and falling back to /usr/bin/gcc in some cases HOT 4
- Add support for generating .map files HOT 7
- GCC toolchain declaration shouldn't use global platforms HOT 4
- Understanding the "Getting started" example code: register_execution_platforms() registers target platforms? HOT 5
- Target 'wasm64' not declared HOT 1
- Feature request: Support llvm-embedded-toolchain-for-arm
- Unable to build sample on Windows 11
- Bazel 7 support
- Executable not found while using toolchain with `foreign_rules_cc`
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from bazel-embedded.