Thomas-Tsai / partclone

Partclone provides utilities to backup a partition smartly and it is designed for higher compatibility of the file system by using existing library.
GNU General Public License v2.0
323 stars 107 forks source link

partclone does not compile with uclibc due to mcheck.h header missing #218

Closed dtronche closed 1 year ago

dtronche commented 1 year ago

We use the cross-compiler buildroot to compile a project integrating partclone. Builroot uses the uclibc library by default instead of glibc. The following error is displayed during partclone compilation:

main.c:25:10: fatal error: mcheck.h: No such file or directory 25 | #include | ^~~~~~ Indeed mcheck.h is not part of uclibc whereas it is available on glibc.

I think the mcheck header should be included in a MEMTRACE ifdef the same way as the mtrace call. Ideally configure should not allow enable-memtrace if mcheck.h header does not exist.

Also it does not seem the -DMEMTRACE option is properly used when compiling main.c as after patching main.c to only include mcheck.h within a #ifdef MEMTRACE, it compiles even if enable-memtrace is set whereas I expected the same error message.