From b695c297cd96b28261def32cbb0c0df6cd12eb67 Mon Sep 17 00:00:00 2001 From: Andrew Johnston Date: Thu, 30 Nov 2023 22:45:35 +0000 Subject: [PATCH] fix mbedtls build --- TODO.md | 1 + lib/mbedtls/api.js | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/TODO.md b/TODO.md index 72134e9..eec80b5 100644 --- a/TODO.md +++ b/TODO.md @@ -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 diff --git a/lib/mbedtls/api.js b/lib/mbedtls/api.js index 772267f..603c1bf 100644 --- a/lib/mbedtls/api.js +++ b/lib/mbedtls/api.js @@ -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) }