This is the mail archive of the
glibc-bugs@sourceware.org
mailing list for the glibc project.
[Bug glob/22194] New: Building glob outside of glibc fails
- From: "psmith at gnu dot org" <sourceware-bugzilla at sourceware dot org>
- To: glibc-bugs at sourceware dot org
- Date: Sat, 23 Sep 2017 22:45:33 +0000
- Subject: [Bug glob/22194] New: Building glob outside of glibc fails
- Auto-submitted: auto-generated
https://sourceware.org/bugzilla/show_bug.cgi?id=22194
Bug ID: 22194
Summary: Building glob outside of glibc fails
Product: glibc
Version: unspecified
Status: NEW
Severity: normal
Priority: P2
Component: glob
Assignee: unassigned at sourceware dot org
Reporter: psmith at gnu dot org
Target Milestone: ---
GNU make contains its own version of the glob library, which it compiles on
systems which do not support sufficiently competent glob implementations
(basically, any system without glibc).
The last time GNU make took a drop of the glibc glob implementation was in
1999.
I'm trying to integrate a new drop (based on the current Git master HEAD
2f49ce7d626) and am finding a number of problems when compiling glob without
the _LIBC option set:
There's a syntax error in alloca_account() in fnmatch.c:
diff --git a/glob/fnmatch.c b/glob/fnmatch.c
index 62df3ec..ae28b56 100644
--- a/glob/fnmatch.c
+++ b/glob/fnmatch.c
@@ -37,7 +37,7 @@
#ifdef _LIBC
# include <alloca.h>
#else
-# define alloca_account(size., var) alloca (size)
+# define alloca_account(size, var) alloca (size)
#endif
In glob.c, FLEXIBLE_ARRAY_MEMBER is only defined if _LIBC is defined:
diff --git a/glob/glob.c b/glob/glob.c
index c699177..f1faa05 100644
--- a/glob/glob.c
+++ b/glob/glob.c
@@ -68,6 +68,7 @@
# endif
# define __readdir readdir
# define COMPILE_GLOB64
+# define FLEXIBLE_ARRAY_MEMBER 1
#endif /* _LIBC */
#include <fnmatch.h>
Beyond that, in order to build an external glob library I now need these files:
- fnmatch.c
- fnmatch.h
- glob.c
- glob.h
- glob_internal.h
- flexmember.h
- scratch_buffer.h
In scratch_buffer.h, libc_hidden_proto() is used but is nowhere defined.
In glob.c, __THROWNL is used but nowhere defined.
In glob.c, attribute_hidden is used but nowhere defined.
In glob.c, mempcpy() is used extensively which is not declared/available unless
_GNU_SOURCE is set.
In both glob.c and fnmatch.c, __set_errno() is used but nowhere defined.
After hacking around these issues I can build a version of glob and link it
with GNU make and it works, with GCC on GNU/Linux with glibc also installed.
Note I have not yet tried on other systems such as Windows, VMS, etc. and with
other compilers.
--
You are receiving this mail because:
You are on the CC list for the bug.