Skip to contentSkip to conversation

build failure with VDSO on non-glibc based systems

DISCUSSION Szabolcs Nagy 2 participants 2 messages Jun 23, 2015

lore
Share & tools
lore
#0 lore raw

if the host toolchain is not glibc based then the arm kernel build fails with

arch/arm/vdso/vdsomunge.c:53:19: fatal error: error.h: No such file or directory

error.h is a glibc only header (ie not available in musl, newlib and bsd libcs).

i attached a patch that fixes the build failure for me.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-fix-arm-vdsomunge-not-to-depend-on-glibc-specific-er.patch
Type: text/x-patch
Size: 4168 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20150623/81f37be6/attachment.bin>

#1 lore raw
Quoted 5 lines · Szabolcs Nagy

if the host toolchain is not glibc based then the arm kernel build fails with

arch/arm/vdso/vdsomunge.c:53:19: fatal error: error.h: No such file or directory

error.h is a glibc only header (ie not available in musl, newlib and bsd libcs).

Thanks for the report and the patch. I agree it is inappropriate to unnecessarily depend on glibc features in host programs.

Quoted 1 line

i attached a patch that fixes the build failure for me.

A few issues with the patch prevent me from accepting it as-is.

The patch lacks the required Signed-off-by: line; see part 11 in Documentation/SubmittingPatches.

The body of your email would suffice as the commit log; please include it in the patch itself.

Review

Quoted 7 lines
(quoted diff) +6 -0
+#define fail(...) ( \
+	failed = 1, \
+	fprintf(stderr, "%s: ", argv0), \
+	fprintf(stderr, __VA_ARGS__), \
+	exit(EXIT_FAILURE))
+

It would be more in keeping with Linux coding style to write this as a do { ... } while (0) block (Chapter 12 of Documentation/CodingStyle).

Writing it as a function, if possible, would be best.

Please attend to these issues and resubmit. Alternatively, I have a musl installation I can test with and develop an equivalent fix (crediting you with the initial report, of course).