Skip to contentSkip to conversation

src/statx: fix undefined reference to xfstests_statx

PATCH In review Zorro Lang 2 participants 3 messages Aug 9, 2018 – Aug 10, 2018

lore
Share & tools
lore

Zorro Lang

author
#0 lore raw

PATCH 1/1 src/statx: fix undefined reference to xfstests_statx

xfstests build fails after glibc updated to 2.28:

/tmp/cc3s96Dw.o: In function `main':
/root/xfstests-dev/src/stat_test.c:690: undefined reference to xfstests_statx' /tmp/cc3s96Dw.o: In function get_reference':
/root/xfstests-dev/src/stat_test.c:301: undefined reference to xfstests_statx' /tmp/cc3s96Dw.o: In function main':
/root/xfstests-dev/src/stat_test.c:642: undefined reference to `xfstests_statx'
collect2: error: ld returned 1 exit status
gmake[2]: *** [Makefile:82: stat_test] Error 1
gmake[1]: *** [include/buildrules:31: src] Error 2
make: *** [Makefile:53: default] Error 2

Due to glibc-headers-2.28 defines struct statx and all related things, include STATX_TYPE. But xfstests src/statx.h won't build xfstests_statx() function STATX_TYPE has been defined, that doesn't make sense.

If all statx things has been defined by glibc, we can skip xfstests internal statx definition, but xfstests_statx() function is still needed, because it's called by other programs.

---

CC David Howells <[email protected]>, the original author of src/statx.h. For this change won't break his original design.

Thanks,
Zorro

 src/statx.h | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
src/statx.h +2 -1
index 5d58208a..f6aaafd6 100644
@@ -160,6 +160,8 @@ struct statx {
 
 #define STATX_ATTR_AUTOMOUNT		0x00001000 /* Dir: Automount trigger */
 
+#endif /* STATX_TYPE */
+
 static inline
 int xfstests_statx(int dfd, const char *filename, unsigned flags,
 		   unsigned int mask, struct statx *buffer)
@@ -172,5 +174,4 @@ int xfstests_statx(int dfd, const char *filename, unsigned flags,
 #endif
 }
 
-#endif /* STATX_TYPE */
 #endif /* STATX_H */
Signature · 1 line
2.14.4
#1 lore raw
Quoted 18 lines · Zorro Lang

xfstests build fails after glibc updated to 2.28:

/tmp/cc3s96Dw.o: In function `main':
/root/xfstests-dev/src/stat_test.c:690: undefined reference to xfstests_statx' /tmp/cc3s96Dw.o: In function get_reference':
/root/xfstests-dev/src/stat_test.c:301: undefined reference to xfstests_statx' /tmp/cc3s96Dw.o: In function main':
/root/xfstests-dev/src/stat_test.c:642: undefined reference to `xfstests_statx'
collect2: error: ld returned 1 exit status
gmake[2]: *** [Makefile:82: stat_test] Error 1
gmake[1]: *** [include/buildrules:31: src] Error 2
make: *** [Makefile:53: default] Error 2

Due to glibc-headers-2.28 defines struct statx and all related things, include STATX_TYPE. But xfstests src/statx.h won't build xfstests_statx() function STATX_TYPE has been defined, that doesn't make sense.

Quoted 5 lines

If all statx things has been defined by glibc, we can skip xfstests internal statx definition, but xfstests_statx() function is still needed, because it's called by other programs.

Lu sent the same fix 2 days ago:

https://patchwork.kernel.org/patch/10558653/

Quoted 37 lines

---

CC David Howells <[email protected]>, the original author of src/statx.h. For this change won't break his original design.

Thanks,
Zorro

 src/statx.h | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
src/statx.h +2 -2
index 5d58208a..f6aaafd6 100644
@@ -160,6 +160,8 @@ struct statx {
 
 #define STATX_ATTR_AUTOMOUNT           0x00001000 /* Dir: Automount trigger */
 
+#endif /* STATX_TYPE */
+
 static inline
 int xfstests_statx(int dfd, const char *filename, unsigned flags,
                   unsigned int mask, struct statx *buffer)
@@ -172,5 +174,4 @@ int xfstests_statx(int dfd, const char *filename, unsigned flags,
 #endif
 }
 
-#endif /* STATX_TYPE */
 #endif /* STATX_H */
--

2.14.4

--
To unsubscribe from this list: send the line "unsubscribe fstests" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

Signature · 3 lines
Filipe David Manana,

“Whether you think you can, or you think you can't — you're right.”
author
#2 lore raw
Quoted 23 lines · Filipe Manana
Quoted 22 lines · Zorro Lang

xfstests build fails after glibc updated to 2.28:

/tmp/cc3s96Dw.o: In function `main':
/root/xfstests-dev/src/stat_test.c:690: undefined reference to xfstests_statx' /tmp/cc3s96Dw.o: In function get_reference':
/root/xfstests-dev/src/stat_test.c:301: undefined reference to xfstests_statx' /tmp/cc3s96Dw.o: In function main':
/root/xfstests-dev/src/stat_test.c:642: undefined reference to `xfstests_statx'
collect2: error: ld returned 1 exit status
gmake[2]: *** [Makefile:82: stat_test] Error 1
gmake[1]: *** [include/buildrules:31: src] Error 2
make: *** [Makefile:53: default] Error 2

Due to glibc-headers-2.28 defines struct statx and all related things, include STATX_TYPE. But xfstests src/statx.h won't build xfstests_statx() function STATX_TYPE has been defined, that doesn't make sense.

If all statx things has been defined by glibc, we can skip xfstests internal statx definition, but xfstests_statx() function is still needed, because it's called by other programs.

Quoted 5 lines
Quoted 1 line

Lu sent the same fix 2 days ago:

https://patchwork.kernel.org/patch/10558653/

OK, Great :)

Thanks,
Zorro

Quoted 50 lines
Quoted 39 lines

---

CC David Howells <[email protected]>, the original author of src/statx.h. For this change won't break his original design.

Thanks,
Zorro

 src/statx.h | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
src/statx.h +2 -2
index 5d58208a..f6aaafd6 100644
@@ -160,6 +160,8 @@ struct statx {
 
 #define STATX_ATTR_AUTOMOUNT           0x00001000 /* Dir: Automount trigger */
 
+#endif /* STATX_TYPE */
+
 static inline
 int xfstests_statx(int dfd, const char *filename, unsigned flags,
                   unsigned int mask, struct statx *buffer)
@@ -172,5 +174,4 @@ int xfstests_statx(int dfd, const char *filename, unsigned flags,
 #endif
 }
 
-#endif /* STATX_TYPE */
 #endif /* STATX_H */
--

2.14.4

--
To unsubscribe from this list: send the line "unsubscribe fstests" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

Signature · 7 lines
Filipe David Manana,

“Whether you think you can, or you think you can't — you're right.”
--
To unsubscribe from this list: send the line "unsubscribe fstests" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html