From: Kevin Day Date: Fri, 9 Jul 2021 01:27:10 +0000 (-0500) Subject: Update: Add cygwin rough documentation. X-Git-Tag: 0.5.4^0 X-Git-Url: https://git.kevux.org/?a=commitdiff_plain;h=1e170730a75586318d8944f1f5a990f88b57a8ea;p=fll Update: Add cygwin rough documentation. I had access to a Windows box and was curious to see if I could compile my project on Windows. To my surprise, with Cygwin and only a minor set of changes, the byte_dump program compiled and worked flawlessly. --- diff --git a/documents/cygwin.txt b/documents/cygwin.txt new file mode 100644 index 0000000..8439b66 --- /dev/null +++ b/documents/cygwin.txt @@ -0,0 +1,31 @@ +The following are a collection of informal notes on getting this to compile and run under Windows using Cygwin. +I may formalize this at a later point in time. + +I have tested and was able to successfully (statically) compile and run FLL+Byte Dump under Cygwin. +The resulting binary could be transfered to another machine and runs if the cygwin.dll is copied with it (placed along the byte_dump.exe). + +To compile the FLL, some functionality needs to be disabled. +Fortunately, FLL is specifically designed to be hackable so the process is easier that it might otherwise be. + +For a monolithic build, compiled statically, add the following to "defines_all" in the "data/build/settings" file. + "-D_di_libcap_ -D_pthread_attr_unsupported_ -D_pthread_sigqueue_unsupported_ -D_di_f_attribute_visibility_ -Df_attribute_visibility_hidden -Df_attribute_visibility_internal -Df_attribute_visibility_protected -Df_attribute_visibility_public" + +The file level_1/fl_control_group/c/control_group.c (for function fl_control_group_apply()) had to have the following changed from: + if (unshare(CLONE_NEWCGROUP) < 0) { + if (errno == EINVAL) return F_status_set_error(F_parameter); + if (errno == ENOMEM) return F_status_set_error(F_memory_not); + if (errno == ENOSPC) return F_status_set_error(F_space_not); + if (errno == EPERM) return F_status_set_error(F_prohibited); + + return F_status_set_error(F_failure); + } +to: + return F_status_set_error(F_supported_not); + +There may have been other things to disable that I forgot to document. + +I do not believe I had to make any changes to compile byte_dump. + +Compiling byte_dump statically against the FLL library is a bit inefficient in that it contains the entire FLL library. +The byte_dump program only needs a portion of it. +I may need to provide a list of everything that can be disabled to provide a smaller and more optimal byte_dump binary.