Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix mbedtls build #11

Merged
merged 1 commit into from
Nov 30, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions TODO.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@
- [ ] **bug** : mbedtls fails to compile on raspberry pi
- [ ] **todo**: redirection of stdin/out/err for child processes
- [ ] **todo**: cacheing for binding dependencies builder
- [ ] **todo**: fix the CC env var issue. this should be C compiler, not C++

## modules

Expand Down
3 changes: 2 additions & 1 deletion lib/mbedtls/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,8 @@ async function build (C = 'gcc', CC = 'g++') {
if (obj.some(o => !isFile(o))) {
assert(chdir('deps/mbedtls') === 0)
const status = new Int32Array(2)
exec('make', ['CFLAGS=-fPIC', 'lib'], status)
// this fixes an issue using g++ to compile C code as CC should really be the C compiler, not the C++ one. need to fix
exec('make', [`CC="${C}"`, 'CFLAGS=-fPIC', 'lib'], status)
assert(status[0] === 0)
assert(chdir('../../') === 0)
}
Expand Down