Hi Steffen,

On 6/8/22 12:18 AM, Steffen Nurpmeso wrote:
[Please note: This e-mail is from an EXTERNAL e-mail address]

Hello Mingli Yu!

Sorry for the delay: as a last thing yesterday i uploaded a new
version of my little s-postgray policy server, and forgot to make
it accessible for postfix (it was 0700 not 0755), so no mail
delivery was possible..

mingli...@windriver.com wrote in
  <20220607031904.3873492-1-mingli...@windriver.com>:
  |From: Mingli Yu <mingli...@windriver.com>
  |
  |Fixes:
  ...
  || 6_64-wrs-linux/12.1.0/ld: mx-047.o: in function `a_nm_alias_expand':
  || /usr/src/debug/s-nail/14.9.24-r0/s-nail-14.9.24/src/mx/names.c:308: \
  || undefined reference to `su_cs_dict_lookup'
  ...
  || 36: undefined reference to `su_mem_get_can_book'
  |  collect2: error: ld returned 1 exit status

Hm.

  |Signed-off-by: Mingli Yu <mingli...@windriver.com>
  |---
  | include/su/cs-dict.h | 2 +-
  | include/su/mem.h     | 2 +-
  | 2 files changed, 2 insertions(+), 2 deletions(-)
  ...
  | /*! Lookup a value, return it (possibly \NIL) or \NIL. */
  |-INLINE void *su_cs_dict_lookup(struct su_cs_dict *self, char const *key){
  |+static inline void *su_cs_dict_lookup(struct su_cs_dict *self, char \
  ...
  |-INLINE boole su_mem_get_can_book(uz size, uz no, uz notoadd){
  |+static inline boole su_mem_get_can_book(uz size, uz no, uz notoadd){

No Mingli Yu, this does not seem right.
I can compile 14.9.24 with gcc 12.1.0 here.
Which were your $CFLAGS, you came there with OPT_AUTOCC=no, did
you?  INLINE comes from include/su/code.h.  Why only these two,

Yes, OPT_AUTOCC=no in my env. And CFLAGS is "-Og -g -feliminate-unused-debug-types" and it turns out only two have problems though there are too many "INLINE" functions and I'm also confused.

there are many dozens "INLINE" functions?

I once have seen something similar, and that was under AlpineLinux
with -Os optimization flag, a bug in gcc 8.3.0, contradicting
documentation, (not all) inline functions became inlined.
I suspect we see this here again?

Unfortunately back in 2019 i found no way of detecting _which_
optimization level is in use.

So.  To work around this suspected gcc bug you could either pass
-std=c89 (in $CFLAGS, or in $EXTRA_CFLAGS if you use

And it works after pass -std=c89 to CFLAGS.

OPT_AUTOCC=y), then we should end up like

   #   define su_INLINE extern __inline __attribute__((gnu_inline))
   #   define su_SINLINE static __inline __attribute__((gnu_inline))

which should work out fine; or you apply the below.

Thank you for reporting this, if i am right i think i will
shortcut gcc now and never trust they get it right!

And sorry for the inconvience of having to spend time on such
a minor program.  And then the SMTP mess..  :)

Ciao!

diff --git a/include/su/code.h b/include/su/code.h
index ef44a0b573..ffabbd1463 100644
--- a/include/su/code.h
+++ b/include/su/code.h
@@ -445,8 +445,11 @@ do{\
  #  define su_INLINE inline /*!< \_ */
  #  define su_SINLINE inline /*!< \_ */
  # elif su_CC_GCC
+#  if 1
+#   define su_INLINE extern __inline __attribute__((gnu_inline))
+#   define su_SINLINE static __inline __attribute__((gnu_inline))
     /* After lots of trouble with OpenBSD/gcc 4.2.1 and SunOS/gcc 3.4.3 */
-#  if !su_CC_VCHECK_GCC(3, 2) /* Unsure: only used C++ at that time */
+#  elif !su_CC_VCHECK_GCC(3, 2) /* Unsure: only used C++ at that time */
  #   define su_INLINE extern __inline
  #   define su_SINLINE static __inline
  #  elif !su_CC_VCHECK_GCC(4, 3)


The above patch also works.

Thanks,
Mingli


--steffen
|
|Der Kragenbaer,                The moon bear,
|der holt sich munter           he cheerfully and one by one
|einen nach dem anderen runter  wa.ks himself off
|(By Robert Gernhardt)

Reply via email to