Skip to contentSkip to conversation

configure: Fix build for some versions of glibc (9pfs)

PATCH In review Stefan Weil 3 participants 5 messages Jun 7, 2012 – Jun 12, 2012

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 configure: Fix build for some versions of glibc (9pfs)

Some versions declare open_by_handle_at, but don't define AT_EMPTY_PATH. Extend the check in configure to test both preconditions.

---
 configure |    4 ++++
 1 file changed, 4 insertions(+)
configure +4 -0
index 799ad0f..f737f6c 100755
@@ -2816,7 +2816,11 @@ fi
 open_by_hande_at=no
 cat > $TMPC << EOF
 #include <fcntl.h>
+#if !defined(AT_EMPTY_PATH)
+# error missing definition
+#else
 int main(void) { struct file_handle fh; return open_by_handle_at(0, &fh, 0); }
+#endif
 EOF
 if compile_prog "" "" ; then
     open_by_handle_at=yes
Signature · 1 line
1.7.10
Acked-by on v1 1/1
#1 lore raw
Quoted 4 lines · Stefan Weil

Some versions declare open_by_handle_at, but don't define AT_EMPTY_PATH. Extend the check in configure to test both preconditions.

It works for me. Also I think it is a better fix than the original patch.

Quoted 22 lines
 configure |    4 ++++
 1 file changed, 4 insertions(+)
configure +4 -0
index 799ad0f..f737f6c 100755
@@ -2816,7 +2816,11 @@ fi
 open_by_hande_at=no
 cat > $TMPC << EOF
 #include <fcntl.h>
+#if !defined(AT_EMPTY_PATH)
+# error missing definition
+#else
 int main(void) { struct file_handle fh; return open_by_handle_at(0, &fh, 0); }
+#endif
 EOF
 if compile_prog "" "" ; then
     open_by_handle_at=yes
Signature · 1 line
1.7.10
Acked-by
#2 lore raw
Quoted 8 lines · Stefano Stabellini
Quoted 4 lines · Stefan Weil

Some versions declare open_by_handle_at, but don't define AT_EMPTY_PATH. Extend the check in configure to test both preconditions.

It works for me. Also I think it is a better fix than the original patch.

Well, it works in that it allows compilation to proceed. It results in ./libhw64/9pfs/virtio-9p-handle.o not being built, since AT_EMPTY_PATH can't be found through /usr/include/fcntl.h, even though it can in /usr/include/linux/fcntl.h. I guess that is, unfortunately, the right thing to do.

Oh hey, I think I've found the bug in the debian package causing that problem. Grr.

Quoted 1 line

thanks,
-serge

Quoted 23 lines
Quoted 23 lines
 configure |    4 ++++
 1 file changed, 4 insertions(+)
configure +4 -0
index 799ad0f..f737f6c 100755
@@ -2816,7 +2816,11 @@ fi
 open_by_hande_at=no
 cat > $TMPC << EOF
 #include <fcntl.h>
+#if !defined(AT_EMPTY_PATH)
+# error missing definition
+#else
 int main(void) { struct file_handle fh; return open_by_handle_at(0, &fh, 0); }
+#endif
 EOF
 if compile_prog "" "" ; then
     open_by_handle_at=yes
Signature · 1 line
1.7.10
#3 lore raw
In reply to Stefan Weil
Quoted 4 lines · Stefan Weil

Some versions declare open_by_handle_at, but don't define AT_EMPTY_PATH. Extend the check in configure to test both preconditions.

I have just noticed that this issue also affects QEMU 1.0.x, but we don't have a check for virtfs there.
Maybe we need the original patch in the QEMU 1.0 stable tree?

Quoted 22 lines
 configure |    4 ++++
 1 file changed, 4 insertions(+)
configure +4 -0
index 799ad0f..f737f6c 100755
@@ -2816,7 +2816,11 @@ fi
 open_by_hande_at=no
 cat > $TMPC << EOF
 #include <fcntl.h>
+#if !defined(AT_EMPTY_PATH)
+# error missing definition
+#else
 int main(void) { struct file_handle fh; return open_by_handle_at(0, &fh, 0); }
+#endif
 EOF
 if compile_prog "" "" ; then
     open_by_handle_at=yes
Signature · 1 line
1.7.10
#4 lore raw
Quoted 9 lines · Stefano Stabellini
Quoted 4 lines · Stefan Weil

Some versions declare open_by_handle_at, but don't define AT_EMPTY_PATH. Extend the check in configure to test both preconditions.

I have just noticed that this issue also affects QEMU 1.0.x, but we don't have a check for virtfs there.
Maybe we need the original patch in the QEMU 1.0 stable tree?

ping?