ruby-core@ruby-lang.org archive (unofficial mirror)
 help / color / mirror / Atom feed
* [ruby-core:103241] [Ruby master Bug#17777] 2.6.7 fails to build on macOS: implicit declaration of function 'rb_native_mutex_destroy' is invalid in C99
@ 2021-04-05 17:14 eregontp
  2021-04-05 17:17 ` [ruby-core:103242] " chris
                   ` (14 more replies)
  0 siblings, 15 replies; 17+ messages in thread
From: eregontp @ 2021-04-05 17:14 UTC (permalink / raw)
  To: ruby-core

Issue #17777 has been reported by Eregon (Benoit Daloze).

----------------------------------------
Bug #17777: 2.6.7 fails to build on macOS: implicit declaration of function 'rb_native_mutex_destroy' is invalid in C99
https://bugs.ruby-lang.org/issues/17777

* Author: Eregon (Benoit Daloze)
* Status: Open
* Priority: Normal
* ruby -v: 2.6.7
* Backport: 2.5: UNKNOWN, 2.6: UNKNOWN, 2.7: UNKNOWN, 3.0: UNKNOWN
----------------------------------------
https://github.com/ruby/ruby-builder/runs/2271346109?check_suite_focus=true#step:14:11253
```
vm.c:2295:9: error: implicit declaration of function 'rb_native_mutex_destroy' is invalid in C99 
```

There is also a warning below that might be worth solving:
```
vm.c:2489:34: warning: expression does not compute the number of elements in this array; element type is 'const int', not 'VALUE' (aka 'unsigned long') [-Wsizeof-array-div]
                             sizeof(ec->machine.regs) / sizeof(VALUE));
                                    ~~~~~~~~~~~~~~~~  ^
vm.c:2489:34: note: place parentheses around the 'sizeof(VALUE)' expression to silence this warning
```



-- 
https://bugs.ruby-lang.org/

^ permalink raw reply	[flat|nested] 17+ messages in thread

* [ruby-core:103242] [Ruby master Bug#17777] 2.6.7 fails to build on macOS: implicit declaration of function 'rb_native_mutex_destroy' is invalid in C99
  2021-04-05 17:14 [ruby-core:103241] [Ruby master Bug#17777] 2.6.7 fails to build on macOS: implicit declaration of function 'rb_native_mutex_destroy' is invalid in C99 eregontp
@ 2021-04-05 17:17 ` chris
  2021-04-05 17:19 ` [ruby-core:103243] " eregontp
                   ` (13 subsequent siblings)
  14 siblings, 0 replies; 17+ messages in thread
From: chris @ 2021-04-05 17:17 UTC (permalink / raw)
  To: ruby-core

Issue #17777 has been updated by chrisseaton (Chris Seaton).


I've also been experiencing this build failure and can reproduce on multiple systems.

----------------------------------------
Bug #17777: 2.6.7 fails to build on macOS: implicit declaration of function 'rb_native_mutex_destroy' is invalid in C99
https://bugs.ruby-lang.org/issues/17777#change-91321

* Author: Eregon (Benoit Daloze)
* Status: Open
* Priority: Normal
* ruby -v: 2.6.7
* Backport: 2.5: UNKNOWN, 2.6: UNKNOWN, 2.7: UNKNOWN, 3.0: UNKNOWN
----------------------------------------
https://github.com/ruby/ruby-builder/runs/2271346109?check_suite_focus=true#step:14:11253
```
vm.c:2295:9: error: implicit declaration of function 'rb_native_mutex_destroy' is invalid in C99 
```

There is also a warning below that might be worth solving:
```
vm.c:2489:34: warning: expression does not compute the number of elements in this array; element type is 'const int', not 'VALUE' (aka 'unsigned long') [-Wsizeof-array-div]
                             sizeof(ec->machine.regs) / sizeof(VALUE));
                                    ~~~~~~~~~~~~~~~~  ^
vm.c:2489:34: note: place parentheses around the 'sizeof(VALUE)' expression to silence this warning
```



-- 
https://bugs.ruby-lang.org/

^ permalink raw reply	[flat|nested] 17+ messages in thread

* [ruby-core:103243] [Ruby master Bug#17777] 2.6.7 fails to build on macOS: implicit declaration of function 'rb_native_mutex_destroy' is invalid in C99
  2021-04-05 17:14 [ruby-core:103241] [Ruby master Bug#17777] 2.6.7 fails to build on macOS: implicit declaration of function 'rb_native_mutex_destroy' is invalid in C99 eregontp
  2021-04-05 17:17 ` [ruby-core:103242] " chris
@ 2021-04-05 17:19 ` eregontp
  2021-04-06  2:37 ` [ruby-core:103246] " usa
                   ` (12 subsequent siblings)
  14 siblings, 0 replies; 17+ messages in thread
From: eregontp @ 2021-04-05 17:19 UTC (permalink / raw)
  To: ruby-core

Issue #17777 has been updated by Eregon (Benoit Daloze).


A workaround is `export warnflags=-Wno-error=implicit-function-declaration` and then attempt to build/install 2.6.7 again.

That downgrades the error to a warning, but relying on implicit function declaration seems potentially dangerous as the argument types are unknown.

----------------------------------------
Bug #17777: 2.6.7 fails to build on macOS: implicit declaration of function 'rb_native_mutex_destroy' is invalid in C99
https://bugs.ruby-lang.org/issues/17777#change-91322

* Author: Eregon (Benoit Daloze)
* Status: Open
* Priority: Normal
* ruby -v: 2.6.7
* Backport: 2.5: UNKNOWN, 2.6: UNKNOWN, 2.7: UNKNOWN, 3.0: UNKNOWN
----------------------------------------
https://github.com/ruby/ruby-builder/runs/2271346109?check_suite_focus=true#step:14:11253
```
vm.c:2295:9: error: implicit declaration of function 'rb_native_mutex_destroy' is invalid in C99 
```

There is also a warning below that might be worth solving:
```
vm.c:2489:34: warning: expression does not compute the number of elements in this array; element type is 'const int', not 'VALUE' (aka 'unsigned long') [-Wsizeof-array-div]
                             sizeof(ec->machine.regs) / sizeof(VALUE));
                                    ~~~~~~~~~~~~~~~~  ^
vm.c:2489:34: note: place parentheses around the 'sizeof(VALUE)' expression to silence this warning
```



-- 
https://bugs.ruby-lang.org/

^ permalink raw reply	[flat|nested] 17+ messages in thread

* [ruby-core:103246] [Ruby master Bug#17777] 2.6.7 fails to build on macOS: implicit declaration of function 'rb_native_mutex_destroy' is invalid in C99
  2021-04-05 17:14 [ruby-core:103241] [Ruby master Bug#17777] 2.6.7 fails to build on macOS: implicit declaration of function 'rb_native_mutex_destroy' is invalid in C99 eregontp
  2021-04-05 17:17 ` [ruby-core:103242] " chris
  2021-04-05 17:19 ` [ruby-core:103243] " eregontp
@ 2021-04-06  2:37 ` usa
  2021-04-06  6:20 ` [ruby-core:103249] " udzura
                   ` (11 subsequent siblings)
  14 siblings, 0 replies; 17+ messages in thread
From: usa @ 2021-04-06  2:37 UTC (permalink / raw)
  To: ruby-core

Issue #17777 has been updated by usa (Usaku NAKAMURA).


In principal, we will not change ruby_2_6 no longer except security issue.
But this is a severe build problem, therefore I'll patch for it exceptionally, if a patch verified by macOS user will be provided :)

----------------------------------------
Bug #17777: 2.6.7 fails to build on macOS: implicit declaration of function 'rb_native_mutex_destroy' is invalid in C99
https://bugs.ruby-lang.org/issues/17777#change-91328

* Author: Eregon (Benoit Daloze)
* Status: Open
* Priority: Normal
* ruby -v: 2.6.7
* Backport: 2.6: REQUIRED, 2.7: DONTNEED, 3.0: DONTNEED
----------------------------------------
https://github.com/ruby/ruby-builder/runs/2271346109?check_suite_focus=true#step:14:11253
```
vm.c:2295:9: error: implicit declaration of function 'rb_native_mutex_destroy' is invalid in C99 
```

There is also a warning below that might be worth solving:
```
vm.c:2489:34: warning: expression does not compute the number of elements in this array; element type is 'const int', not 'VALUE' (aka 'unsigned long') [-Wsizeof-array-div]
                             sizeof(ec->machine.regs) / sizeof(VALUE));
                                    ~~~~~~~~~~~~~~~~  ^
vm.c:2489:34: note: place parentheses around the 'sizeof(VALUE)' expression to silence this warning
```



-- 
https://bugs.ruby-lang.org/

^ permalink raw reply	[flat|nested] 17+ messages in thread

* [ruby-core:103249] [Ruby master Bug#17777] 2.6.7 fails to build on macOS: implicit declaration of function 'rb_native_mutex_destroy' is invalid in C99
  2021-04-05 17:14 [ruby-core:103241] [Ruby master Bug#17777] 2.6.7 fails to build on macOS: implicit declaration of function 'rb_native_mutex_destroy' is invalid in C99 eregontp
                   ` (2 preceding siblings ...)
  2021-04-06  2:37 ` [ruby-core:103246] " usa
@ 2021-04-06  6:20 ` udzura
  2021-04-06  9:46 ` [ruby-core:103252] " xtkoba+ruby
                   ` (10 subsequent siblings)
  14 siblings, 0 replies; 17+ messages in thread
From: udzura @ 2021-04-06  6:20 UTC (permalink / raw)
  To: ruby-core

Issue #17777 has been updated by udzura (Uchio KONDO).


Hi, 

Using MacOS 10.15.7 / Apple clang version 11.0.3 (clang-1103.0.32.62), building ruby 2.6.7 will be sccessful.

Using MacOS 10.15.7 / Apple clang version 12.0.0 (clang-1200.0.32.28), it is broken (reported by @ima1zumi).

I hope this will be of some help.


----------------------------------------
Bug #17777: 2.6.7 fails to build on macOS: implicit declaration of function 'rb_native_mutex_destroy' is invalid in C99
https://bugs.ruby-lang.org/issues/17777#change-91331

* Author: Eregon (Benoit Daloze)
* Status: Open
* Priority: Normal
* ruby -v: 2.6.7
* Backport: 2.6: REQUIRED, 2.7: DONTNEED, 3.0: DONTNEED
----------------------------------------
https://github.com/ruby/ruby-builder/runs/2271346109?check_suite_focus=true#step:14:11253
```
vm.c:2295:9: error: implicit declaration of function 'rb_native_mutex_destroy' is invalid in C99 
```

There is also a warning below that might be worth solving:
```
vm.c:2489:34: warning: expression does not compute the number of elements in this array; element type is 'const int', not 'VALUE' (aka 'unsigned long') [-Wsizeof-array-div]
                             sizeof(ec->machine.regs) / sizeof(VALUE));
                                    ~~~~~~~~~~~~~~~~  ^
vm.c:2489:34: note: place parentheses around the 'sizeof(VALUE)' expression to silence this warning
```



-- 
https://bugs.ruby-lang.org/

^ permalink raw reply	[flat|nested] 17+ messages in thread

* [ruby-core:103252] [Ruby master Bug#17777] 2.6.7 fails to build on macOS: implicit declaration of function 'rb_native_mutex_destroy' is invalid in C99
  2021-04-05 17:14 [ruby-core:103241] [Ruby master Bug#17777] 2.6.7 fails to build on macOS: implicit declaration of function 'rb_native_mutex_destroy' is invalid in C99 eregontp
                   ` (3 preceding siblings ...)
  2021-04-06  6:20 ` [ruby-core:103249] " udzura
@ 2021-04-06  9:46 ` xtkoba+ruby
  2021-04-06 23:47 ` [ruby-core:103259] " halostatue
                   ` (9 subsequent siblings)
  14 siblings, 0 replies; 17+ messages in thread
From: xtkoba+ruby @ 2021-04-06  9:46 UTC (permalink / raw)
  To: ruby-core

Issue #17777 has been updated by xtkoba (Tee KOBAYASHI).


I believe this issue was introduced by #15852#note-9 (backport of commit:2a83650b0fd25719fb6c03bfec7bd895734d3ceb into ruby_2_6).

A workaround is to define a prototype of the function `rb_native_mutex_destroy` before it is called, as in the following patch:
```patch
--- ruby-2.6.7/vm.c.orig
+++ ruby-2.6.7/vm.c
@@ -2292,6 +2292,7 @@ ruby_vm_destruct(rb_vm_t *vm)
 	if (objspace) {
 	    rb_objspace_free(objspace);
 	}
+        void rb_native_mutex_destroy(rb_nativethread_lock_t *);
         rb_native_mutex_destroy(&vm->waitpid_lock);
         rb_native_mutex_destroy(&vm->workqueue_lock);
 	/* after freeing objspace, you *can't* use ruby_xfree() */
```


----------------------------------------
Bug #17777: 2.6.7 fails to build on macOS: implicit declaration of function 'rb_native_mutex_destroy' is invalid in C99
https://bugs.ruby-lang.org/issues/17777#change-91334

* Author: Eregon (Benoit Daloze)
* Status: Open
* Priority: Normal
* ruby -v: 2.6.7
* Backport: 2.6: REQUIRED, 2.7: DONTNEED, 3.0: DONTNEED
----------------------------------------
https://github.com/ruby/ruby-builder/runs/2271346109?check_suite_focus=true#step:14:11253
```
vm.c:2295:9: error: implicit declaration of function 'rb_native_mutex_destroy' is invalid in C99 
```

There is also a warning below that might be worth solving:
```
vm.c:2489:34: warning: expression does not compute the number of elements in this array; element type is 'const int', not 'VALUE' (aka 'unsigned long') [-Wsizeof-array-div]
                             sizeof(ec->machine.regs) / sizeof(VALUE));
                                    ~~~~~~~~~~~~~~~~  ^
vm.c:2489:34: note: place parentheses around the 'sizeof(VALUE)' expression to silence this warning
```



-- 
https://bugs.ruby-lang.org/

^ permalink raw reply	[flat|nested] 17+ messages in thread

* [ruby-core:103259] [Ruby master Bug#17777] 2.6.7 fails to build on macOS: implicit declaration of function 'rb_native_mutex_destroy' is invalid in C99
  2021-04-05 17:14 [ruby-core:103241] [Ruby master Bug#17777] 2.6.7 fails to build on macOS: implicit declaration of function 'rb_native_mutex_destroy' is invalid in C99 eregontp
                   ` (4 preceding siblings ...)
  2021-04-06  9:46 ` [ruby-core:103252] " xtkoba+ruby
@ 2021-04-06 23:47 ` halostatue
  2021-04-06 23:58 ` [ruby-core:103260] " halostatue
                   ` (8 subsequent siblings)
  14 siblings, 0 replies; 17+ messages in thread
From: halostatue @ 2021-04-06 23:47 UTC (permalink / raw)
  To: ruby-core

Issue #17777 has been updated by austin (Austin Ziegler).


Copying the `include/ruby/thread_native.h` from `master`  appears to work to a point. This is what I found: `git show 5e3259ea749 -- include/ruby/thread_native.h`.

```
5e3259ea74 2020-11-17 | fix public interface [Koichi Sasada]

diff --git a/include/ruby/thread_native.h b/include/ruby/thread_native.h
index 0285c8ff40..7e08c2e97f 100644
--- a/include/ruby/thread_native.h
+++ b/include/ruby/thread_native.h
@@ -31,10 +31,14 @@ typedef union rb_thread_lock_union {
     CRITICAL_SECTION crit;
 } rb_nativethread_lock_t;
 
+typedef struct rb_thread_cond_struct rb_nativethread_cond_t;
+
 #elif defined(HAVE_PTHREAD_H)
+
 #include <pthread.h>
 typedef pthread_t rb_nativethread_id_t;
 typedef pthread_mutex_t rb_nativethread_lock_t;
+typedef pthread_cond_t rb_nativethread_cond_t;
 
 #else
 #error "unsupported thread type"
@@ -50,6 +54,19 @@ void rb_nativethread_lock_destroy(rb_nativethread_lock_t *lock);
 void rb_nativethread_lock_lock(rb_nativethread_lock_t *lock);
 void rb_nativethread_lock_unlock(rb_nativethread_lock_t *lock);
 
+void rb_native_mutex_lock(rb_nativethread_lock_t *lock);
+int  rb_native_mutex_trylock(rb_nativethread_lock_t *lock);
+void rb_native_mutex_unlock(rb_nativethread_lock_t *lock);
+void rb_native_mutex_initialize(rb_nativethread_lock_t *lock);
+void rb_native_mutex_destroy(rb_nativethread_lock_t *lock);
+
+void rb_native_cond_signal(rb_nativethread_cond_t *cond);
+void rb_native_cond_broadcast(rb_nativethread_cond_t *cond);
+void rb_native_cond_wait(rb_nativethread_cond_t *cond, rb_nativethread_lock_t *mutex);
+void rb_native_cond_timedwait(rb_nativethread_cond_t *cond, rb_nativethread_lock_t *mutex, unsigned long msec);
+void rb_native_cond_initialize(rb_nativethread_cond_t *cond);
+void rb_native_cond_destroy(rb_nativethread_cond_t *cond);
+
 RUBY_SYMBOL_EXPORT_END
 
 #endif
```

However, when building `ext/fiddle`, I get the following error:

```
closure.c:264:14: error: implicit declaration of function 'ffi_prep_closure' is invalid in C99
      [-Werror,-Wimplicit-function-declaration]
    result = ffi_prep_closure(pcl, cif, callback, (void *)self);
```

I’m not sure _why_ this is failing here, because it doesn’t look like it’s implicit (the function `ffi_prep_closure` is in `ffi.h` which is included from `fiddle.h`, which is included in `closure.c`.

----------------------------------------
Bug #17777: 2.6.7 fails to build on macOS: implicit declaration of function 'rb_native_mutex_destroy' is invalid in C99
https://bugs.ruby-lang.org/issues/17777#change-91342

* Author: Eregon (Benoit Daloze)
* Status: Open
* Priority: Normal
* ruby -v: 2.6.7
* Backport: 2.6: REQUIRED, 2.7: DONTNEED, 3.0: DONTNEED
----------------------------------------
https://github.com/ruby/ruby-builder/runs/2271346109?check_suite_focus=true#step:14:11253
```
vm.c:2295:9: error: implicit declaration of function 'rb_native_mutex_destroy' is invalid in C99 
```

There is also a warning below that might be worth solving:
```
vm.c:2489:34: warning: expression does not compute the number of elements in this array; element type is 'const int', not 'VALUE' (aka 'unsigned long') [-Wsizeof-array-div]
                             sizeof(ec->machine.regs) / sizeof(VALUE));
                                    ~~~~~~~~~~~~~~~~  ^
vm.c:2489:34: note: place parentheses around the 'sizeof(VALUE)' expression to silence this warning
```



-- 
https://bugs.ruby-lang.org/

^ permalink raw reply related	[flat|nested] 17+ messages in thread

* [ruby-core:103260] [Ruby master Bug#17777] 2.6.7 fails to build on macOS: implicit declaration of function 'rb_native_mutex_destroy' is invalid in C99
  2021-04-05 17:14 [ruby-core:103241] [Ruby master Bug#17777] 2.6.7 fails to build on macOS: implicit declaration of function 'rb_native_mutex_destroy' is invalid in C99 eregontp
                   ` (5 preceding siblings ...)
  2021-04-06 23:47 ` [ruby-core:103259] " halostatue
@ 2021-04-06 23:58 ` halostatue
  2021-04-07  0:00 ` [ruby-core:103261] " halostatue
                   ` (7 subsequent siblings)
  14 siblings, 0 replies; 17+ messages in thread
From: halostatue @ 2021-04-06 23:58 UTC (permalink / raw)
  To: ruby-core

Issue #17777 has been updated by austin (Austin Ziegler).


Digging a bit deeper in to this second item; it looks like we’re doing `USE_HEADER_HACKS`, which means we’re loading `<ffi/ffi.h>` and using the compiler that came with Big Sur (based on Xcode 12), I see the following:

```c
#if FFI_LEGACY_CLOSURE_API
FFI_AVAILABLE_APPLE_2019 FFI_API ffi_status
ffi_prep_closure (ffi_closure*,
		  ffi_cif *,
		  void (*fun)(ffi_cif*,void*,void**,void*),
		  void *user_data)
#if defined(__GNUC__) && (((__GNUC__ * 100) + __GNUC_MINOR__) >= 405)
  __attribute__((deprecated ("use ffi_prep_closure_loc instead")))
#elif defined(__GNUC__) && __GNUC__ >= 3
  __attribute__((deprecated))
#endif
  ;
#endif
```

However, it looks like the 2.7 version of `fiddle` does a little more investigation:

```diff
--- ext/fiddle/extconf.rb	2021-04-05 07:48:34.000000000 -0400
+++ ../ruby-2.7.3/ext/fiddle/extconf.rb	2021-04-05 08:39:38.000000000 -0400
@@ -13,7 +13,7 @@
   if have_header(ffi_header = 'ffi.h')
     true
   elsif have_header(ffi_header = 'ffi/ffi.h')
-    $defs.push(format('-DUSE_HEADER_HACKS'))
+    $defs.push('-DUSE_HEADER_HACKS')
     true
   end and (have_library('ffi') || have_library('libffi'))
 end or
@@ -114,8 +114,17 @@
 
 if ver
   ver = ver.gsub(/-rc\d+/, '') # If ver contains rc version, just ignored.
-  ver = (ver.split('.') + [0,0])[0,3]
+  ver = (ver.split('.').map(&:to_i) + [0,0])[0,3]
   $defs.push(%{-DRUBY_LIBFFI_MODVERSION=#{ '%d%03d%03d' % ver }})
+  warn "libffi_version: #{ver.join('.')}"
+end
+
+case
+when $mswin, $mingw, (ver && (ver <=> [3, 2]) >= 0)
+  $defs << "-DUSE_FFI_CLOSURE_ALLOC=1"
+when (ver && (ver <=> [3, 2]) < 0)
+else
+  have_func('ffi_closure_alloc', ffi_header)
 end
 
 have_header 'sys/mman.h'
@@ -142,7 +151,7 @@
   if /^\#define\s+SIZEOF_#{type}\s+(SIZEOF_(.+)|\d+)/ =~ config
     if size = $2 and size != 'VOIDP'
       size = types.fetch(size) {size}
-      $defs << format("-DTYPE_%s=TYPE_%s", signed||type, size)
+      $defs << "-DTYPE_#{signed||type}=TYPE_#{size}"
     end
     if signed
       check_signedness(type.downcase, "stddef.h")
```

This is from 229c041f057.

----------------------------------------
Bug #17777: 2.6.7 fails to build on macOS: implicit declaration of function 'rb_native_mutex_destroy' is invalid in C99
https://bugs.ruby-lang.org/issues/17777#change-91343

* Author: Eregon (Benoit Daloze)
* Status: Open
* Priority: Normal
* ruby -v: 2.6.7
* Backport: 2.6: REQUIRED, 2.7: DONTNEED, 3.0: DONTNEED
----------------------------------------
https://github.com/ruby/ruby-builder/runs/2271346109?check_suite_focus=true#step:14:11253
```
vm.c:2295:9: error: implicit declaration of function 'rb_native_mutex_destroy' is invalid in C99 
```

There is also a warning below that might be worth solving:
```
vm.c:2489:34: warning: expression does not compute the number of elements in this array; element type is 'const int', not 'VALUE' (aka 'unsigned long') [-Wsizeof-array-div]
                             sizeof(ec->machine.regs) / sizeof(VALUE));
                                    ~~~~~~~~~~~~~~~~  ^
vm.c:2489:34: note: place parentheses around the 'sizeof(VALUE)' expression to silence this warning
```



-- 
https://bugs.ruby-lang.org/

^ permalink raw reply	[flat|nested] 17+ messages in thread

* [ruby-core:103261] [Ruby master Bug#17777] 2.6.7 fails to build on macOS: implicit declaration of function 'rb_native_mutex_destroy' is invalid in C99
  2021-04-05 17:14 [ruby-core:103241] [Ruby master Bug#17777] 2.6.7 fails to build on macOS: implicit declaration of function 'rb_native_mutex_destroy' is invalid in C99 eregontp
                   ` (6 preceding siblings ...)
  2021-04-06 23:58 ` [ruby-core:103260] " halostatue
@ 2021-04-07  0:00 ` halostatue
  2021-04-15 20:10 ` [ruby-core:103467] " halostatue
                   ` (6 subsequent siblings)
  14 siblings, 0 replies; 17+ messages in thread
From: halostatue @ 2021-04-07  0:00 UTC (permalink / raw)
  To: ruby-core

Issue #17777 has been updated by austin (Austin Ziegler).


Copying the `ext/fiddle/extconf.rb` from 229c041f057 also seems to work.

----------------------------------------
Bug #17777: 2.6.7 fails to build on macOS: implicit declaration of function 'rb_native_mutex_destroy' is invalid in C99
https://bugs.ruby-lang.org/issues/17777#change-91344

* Author: Eregon (Benoit Daloze)
* Status: Open
* Priority: Normal
* ruby -v: 2.6.7
* Backport: 2.6: REQUIRED, 2.7: DONTNEED, 3.0: DONTNEED
----------------------------------------
https://github.com/ruby/ruby-builder/runs/2271346109?check_suite_focus=true#step:14:11253
```
vm.c:2295:9: error: implicit declaration of function 'rb_native_mutex_destroy' is invalid in C99 
```

There is also a warning below that might be worth solving:
```
vm.c:2489:34: warning: expression does not compute the number of elements in this array; element type is 'const int', not 'VALUE' (aka 'unsigned long') [-Wsizeof-array-div]
                             sizeof(ec->machine.regs) / sizeof(VALUE));
                                    ~~~~~~~~~~~~~~~~  ^
vm.c:2489:34: note: place parentheses around the 'sizeof(VALUE)' expression to silence this warning
```



-- 
https://bugs.ruby-lang.org/

^ permalink raw reply	[flat|nested] 17+ messages in thread

* [ruby-core:103467] [Ruby master Bug#17777] 2.6.7 fails to build on macOS: implicit declaration of function 'rb_native_mutex_destroy' is invalid in C99
  2021-04-05 17:14 [ruby-core:103241] [Ruby master Bug#17777] 2.6.7 fails to build on macOS: implicit declaration of function 'rb_native_mutex_destroy' is invalid in C99 eregontp
                   ` (7 preceding siblings ...)
  2021-04-07  0:00 ` [ruby-core:103261] " halostatue
@ 2021-04-15 20:10 ` halostatue
  2021-04-16  5:25 ` [ruby-core:103471] " hsbt
                   ` (5 subsequent siblings)
  14 siblings, 0 replies; 17+ messages in thread
From: halostatue @ 2021-04-15 20:10 UTC (permalink / raw)
  To: ruby-core

Issue #17777 has been updated by austin (Austin Ziegler).


https://github.com/ruby/ruby/pull/4385

----------------------------------------
Bug #17777: 2.6.7 fails to build on macOS: implicit declaration of function 'rb_native_mutex_destroy' is invalid in C99
https://bugs.ruby-lang.org/issues/17777#change-91562

* Author: Eregon (Benoit Daloze)
* Status: Open
* Priority: Normal
* ruby -v: 2.6.7
* Backport: 2.6: REQUIRED, 2.7: DONTNEED, 3.0: DONTNEED
----------------------------------------
https://github.com/ruby/ruby-builder/runs/2271346109?check_suite_focus=true#step:14:11253
```
vm.c:2295:9: error: implicit declaration of function 'rb_native_mutex_destroy' is invalid in C99 
```

There is also a warning below that might be worth solving:
```
vm.c:2489:34: warning: expression does not compute the number of elements in this array; element type is 'const int', not 'VALUE' (aka 'unsigned long') [-Wsizeof-array-div]
                             sizeof(ec->machine.regs) / sizeof(VALUE));
                                    ~~~~~~~~~~~~~~~~  ^
vm.c:2489:34: note: place parentheses around the 'sizeof(VALUE)' expression to silence this warning
```



-- 
https://bugs.ruby-lang.org/

^ permalink raw reply	[flat|nested] 17+ messages in thread

* [ruby-core:103471] [Ruby master Bug#17777] 2.6.7 fails to build on macOS: implicit declaration of function 'rb_native_mutex_destroy' is invalid in C99
  2021-04-05 17:14 [ruby-core:103241] [Ruby master Bug#17777] 2.6.7 fails to build on macOS: implicit declaration of function 'rb_native_mutex_destroy' is invalid in C99 eregontp
                   ` (8 preceding siblings ...)
  2021-04-15 20:10 ` [ruby-core:103467] " halostatue
@ 2021-04-16  5:25 ` hsbt
  2021-04-20 18:29 ` [ruby-core:103528] " tycho.braams
                   ` (4 subsequent siblings)
  14 siblings, 0 replies; 17+ messages in thread
From: hsbt @ 2021-04-16  5:25 UTC (permalink / raw)
  To: ruby-core

Issue #17777 has been updated by hsbt (Hiroshi SHIBATA).


Fixed at https://github.com/ruby/ruby/pull/4360

----------------------------------------
Bug #17777: 2.6.7 fails to build on macOS: implicit declaration of function 'rb_native_mutex_destroy' is invalid in C99
https://bugs.ruby-lang.org/issues/17777#change-91567

* Author: Eregon (Benoit Daloze)
* Status: Open
* Priority: Normal
* ruby -v: 2.6.7
* Backport: 2.6: REQUIRED, 2.7: DONTNEED, 3.0: DONTNEED
----------------------------------------
https://github.com/ruby/ruby-builder/runs/2271346109?check_suite_focus=true#step:14:11253
```
vm.c:2295:9: error: implicit declaration of function 'rb_native_mutex_destroy' is invalid in C99 
```

There is also a warning below that might be worth solving:
```
vm.c:2489:34: warning: expression does not compute the number of elements in this array; element type is 'const int', not 'VALUE' (aka 'unsigned long') [-Wsizeof-array-div]
                             sizeof(ec->machine.regs) / sizeof(VALUE));
                                    ~~~~~~~~~~~~~~~~  ^
vm.c:2489:34: note: place parentheses around the 'sizeof(VALUE)' expression to silence this warning
```



-- 
https://bugs.ruby-lang.org/

^ permalink raw reply	[flat|nested] 17+ messages in thread

* [ruby-core:103528] [Ruby master Bug#17777] 2.6.7 fails to build on macOS: implicit declaration of function 'rb_native_mutex_destroy' is invalid in C99
  2021-04-05 17:14 [ruby-core:103241] [Ruby master Bug#17777] 2.6.7 fails to build on macOS: implicit declaration of function 'rb_native_mutex_destroy' is invalid in C99 eregontp
                   ` (9 preceding siblings ...)
  2021-04-16  5:25 ` [ruby-core:103471] " hsbt
@ 2021-04-20 18:29 ` tycho.braams
  2021-04-20 19:13 ` [ruby-core:103530] " merch-redmine
                   ` (3 subsequent siblings)
  14 siblings, 0 replies; 17+ messages in thread
From: tycho.braams @ 2021-04-20 18:29 UTC (permalink / raw)
  To: ruby-core

Issue #17777 has been updated by tlbra (tycho braams).


I think it's a bit early to close the issue, as the PR linked by hsbt has not actually been merged in the 2.6 branch yet, so the issue still exists

----------------------------------------
Bug #17777: 2.6.7 fails to build on macOS: implicit declaration of function 'rb_native_mutex_destroy' is invalid in C99
https://bugs.ruby-lang.org/issues/17777#change-91629

* Author: Eregon (Benoit Daloze)
* Status: Closed
* Priority: Normal
* ruby -v: 2.6.7
* Backport: 2.6: REQUIRED, 2.7: DONTNEED, 3.0: DONTNEED
----------------------------------------
https://github.com/ruby/ruby-builder/runs/2271346109?check_suite_focus=true#step:14:11253
```
vm.c:2295:9: error: implicit declaration of function 'rb_native_mutex_destroy' is invalid in C99 
```

There is also a warning below that might be worth solving:
```
vm.c:2489:34: warning: expression does not compute the number of elements in this array; element type is 'const int', not 'VALUE' (aka 'unsigned long') [-Wsizeof-array-div]
                             sizeof(ec->machine.regs) / sizeof(VALUE));
                                    ~~~~~~~~~~~~~~~~  ^
vm.c:2489:34: note: place parentheses around the 'sizeof(VALUE)' expression to silence this warning
```



-- 
https://bugs.ruby-lang.org/

^ permalink raw reply	[flat|nested] 17+ messages in thread

* [ruby-core:103530] [Ruby master Bug#17777] 2.6.7 fails to build on macOS: implicit declaration of function 'rb_native_mutex_destroy' is invalid in C99
  2021-04-05 17:14 [ruby-core:103241] [Ruby master Bug#17777] 2.6.7 fails to build on macOS: implicit declaration of function 'rb_native_mutex_destroy' is invalid in C99 eregontp
                   ` (10 preceding siblings ...)
  2021-04-20 18:29 ` [ruby-core:103528] " tycho.braams
@ 2021-04-20 19:13 ` merch-redmine
  2021-04-20 21:16 ` [ruby-core:103533] " tycho.braams
                   ` (2 subsequent siblings)
  14 siblings, 0 replies; 17+ messages in thread
From: merch-redmine @ 2021-04-20 19:13 UTC (permalink / raw)
  To: ruby-core

Issue #17777 has been updated by jeremyevans0 (Jeremy Evans).


tlbra (tycho braams) wrote in #note-13:
> I think it's a bit early to close the issue, as the PR linked by hsbt has not actually been merged in the 2.6 branch yet, so the issue still exists

You must be unfamiliar with how backporting is handled in Ruby.  If the issue doesn't exist in the master branch but needs backporting, the issue is closed and the appropriate backport flag is set.  The branch maintainer will use a view like https://bugs.ruby-lang.org/projects/ruby-master/issues?query_id=171 to determine which tickets need backporting (note that it includes issues marked Closed, including this ticket).


----------------------------------------
Bug #17777: 2.6.7 fails to build on macOS: implicit declaration of function 'rb_native_mutex_destroy' is invalid in C99
https://bugs.ruby-lang.org/issues/17777#change-91631

* Author: Eregon (Benoit Daloze)
* Status: Closed
* Priority: Normal
* ruby -v: 2.6.7
* Backport: 2.6: REQUIRED, 2.7: DONTNEED, 3.0: DONTNEED
----------------------------------------
https://github.com/ruby/ruby-builder/runs/2271346109?check_suite_focus=true#step:14:11253
```
vm.c:2295:9: error: implicit declaration of function 'rb_native_mutex_destroy' is invalid in C99 
```

There is also a warning below that might be worth solving:
```
vm.c:2489:34: warning: expression does not compute the number of elements in this array; element type is 'const int', not 'VALUE' (aka 'unsigned long') [-Wsizeof-array-div]
                             sizeof(ec->machine.regs) / sizeof(VALUE));
                                    ~~~~~~~~~~~~~~~~  ^
vm.c:2489:34: note: place parentheses around the 'sizeof(VALUE)' expression to silence this warning
```



-- 
https://bugs.ruby-lang.org/

^ permalink raw reply	[flat|nested] 17+ messages in thread

* [ruby-core:103533] [Ruby master Bug#17777] 2.6.7 fails to build on macOS: implicit declaration of function 'rb_native_mutex_destroy' is invalid in C99
  2021-04-05 17:14 [ruby-core:103241] [Ruby master Bug#17777] 2.6.7 fails to build on macOS: implicit declaration of function 'rb_native_mutex_destroy' is invalid in C99 eregontp
                   ` (11 preceding siblings ...)
  2021-04-20 19:13 ` [ruby-core:103530] " merch-redmine
@ 2021-04-20 21:16 ` tycho.braams
  2021-04-21  5:10 ` [ruby-core:103536] " tdehnke
  2021-05-09 16:13 ` [ruby-core:103776] " usa
  14 siblings, 0 replies; 17+ messages in thread
From: tycho.braams @ 2021-04-20 21:16 UTC (permalink / raw)
  To: ruby-core

Issue #17777 has been updated by tlbra (tycho braams).


Yep, I was not aware that that is how it works, thank you for explaining the process.

----------------------------------------
Bug #17777: 2.6.7 fails to build on macOS: implicit declaration of function 'rb_native_mutex_destroy' is invalid in C99
https://bugs.ruby-lang.org/issues/17777#change-91634

* Author: Eregon (Benoit Daloze)
* Status: Closed
* Priority: Normal
* ruby -v: 2.6.7
* Backport: 2.6: REQUIRED, 2.7: DONTNEED, 3.0: DONTNEED
----------------------------------------
https://github.com/ruby/ruby-builder/runs/2271346109?check_suite_focus=true#step:14:11253
```
vm.c:2295:9: error: implicit declaration of function 'rb_native_mutex_destroy' is invalid in C99 
```

There is also a warning below that might be worth solving:
```
vm.c:2489:34: warning: expression does not compute the number of elements in this array; element type is 'const int', not 'VALUE' (aka 'unsigned long') [-Wsizeof-array-div]
                             sizeof(ec->machine.regs) / sizeof(VALUE));
                                    ~~~~~~~~~~~~~~~~  ^
vm.c:2489:34: note: place parentheses around the 'sizeof(VALUE)' expression to silence this warning
```



-- 
https://bugs.ruby-lang.org/

^ permalink raw reply	[flat|nested] 17+ messages in thread

* [ruby-core:103536] [Ruby master Bug#17777] 2.6.7 fails to build on macOS: implicit declaration of function 'rb_native_mutex_destroy' is invalid in C99
  2021-04-05 17:14 [ruby-core:103241] [Ruby master Bug#17777] 2.6.7 fails to build on macOS: implicit declaration of function 'rb_native_mutex_destroy' is invalid in C99 eregontp
                   ` (12 preceding siblings ...)
  2021-04-20 21:16 ` [ruby-core:103533] " tycho.braams
@ 2021-04-21  5:10 ` tdehnke
  2021-04-21 16:18   ` [ruby-core:103542] " Austin Ziegler
  2021-05-09 16:13 ` [ruby-core:103776] " usa
  14 siblings, 1 reply; 17+ messages in thread
From: tdehnke @ 2021-04-21  5:10 UTC (permalink / raw)
  To: ruby-core

Issue #17777 has been updated by tdehnke (Tony Dehnke).


Newbie here,  I jsut ran into this today on my Mac running MacOS 11.2.3 (Intel) 

``` shell
tdehnke@Tonys-MacBook-Pro-15 12vBiz % rbenv install 2.6.7
Downloading ruby-2.6.7.tar.bz2...
-> https://cache.ruby-lang.org/pub/ruby/2.6/ruby-2.6.7.tar.bz2
Installing ruby-2.6.7...
ruby-build: using readline from homebrew

BUILD FAILED (macOS 11.2.3 using ruby-build 20210420)

Inspect or clean up the working tree at /var/folders/r0/vw984xf56318dq54dzjk26wm0000gn/T/ruby-build.20210421115228.39383.OiFuid
Results logged to /var/folders/r0/vw984xf56318dq54dzjk26wm0000gn/T/ruby-build.20210421115228.39383.log

Last 10 log lines:
vm.c:2295:9: error: implicit declaration of function 'rb_native_mutex_destroy' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
        rb_native_mutex_destroy(&vm->waitpid_lock);
        ^
vm.c:2489:34: warning: expression does not compute the number of elements in this array; element type is 'const int', not 'VALUE' (aka 'unsigned long') [-Wsizeof-array-div]
                             sizeof(ec->machine.regs) / sizeof(VALUE));
                                    ~~~~~~~~~~~~~~~~  ^
vm.c:2489:34: note: place parentheses around the 'sizeof(VALUE)' expression to silence this warning
1 warning and 1 error generated.
make: *** [vm.o] Error 1
make: *** Waiting for unfinished jobs....
```


----------------------------------------
Bug #17777: 2.6.7 fails to build on macOS: implicit declaration of function 'rb_native_mutex_destroy' is invalid in C99
https://bugs.ruby-lang.org/issues/17777#change-91638

* Author: Eregon (Benoit Daloze)
* Status: Closed
* Priority: Normal
* ruby -v: 2.6.7
* Backport: 2.6: REQUIRED, 2.7: DONTNEED, 3.0: DONTNEED
----------------------------------------
https://github.com/ruby/ruby-builder/runs/2271346109?check_suite_focus=true#step:14:11253
```
vm.c:2295:9: error: implicit declaration of function 'rb_native_mutex_destroy' is invalid in C99 
```

There is also a warning below that might be worth solving:
```
vm.c:2489:34: warning: expression does not compute the number of elements in this array; element type is 'const int', not 'VALUE' (aka 'unsigned long') [-Wsizeof-array-div]
                             sizeof(ec->machine.regs) / sizeof(VALUE));
                                    ~~~~~~~~~~~~~~~~  ^
vm.c:2489:34: note: place parentheses around the 'sizeof(VALUE)' expression to silence this warning
```



-- 
https://bugs.ruby-lang.org/

^ permalink raw reply	[flat|nested] 17+ messages in thread

* [ruby-core:103542] Re: [Ruby master Bug#17777] 2.6.7 fails to build on macOS: implicit declaration of function 'rb_native_mutex_destroy' is invalid in C99
  2021-04-21  5:10 ` [ruby-core:103536] " tdehnke
@ 2021-04-21 16:18   ` Austin Ziegler
  0 siblings, 0 replies; 17+ messages in thread
From: Austin Ziegler @ 2021-04-21 16:18 UTC (permalink / raw)
  To: Ruby developers

This hasn’t yet been backported. When it has been, there will be a
release that includes the fixes to permit building with Xcode 12.

-a

On Wed, Apr 21, 2021 at 1:10 AM <tdehnke@me.com> wrote:
>
> Issue #17777 has been updated by tdehnke (Tony Dehnke).
>
>
> Newbie here,  I jsut ran into this today on my Mac running MacOS 11.2.3 (Intel)
>
> ``` shell
> tdehnke@Tonys-MacBook-Pro-15 12vBiz % rbenv install 2.6.7
> Downloading ruby-2.6.7.tar.bz2...
> -> https://cache.ruby-lang.org/pub/ruby/2.6/ruby-2.6.7.tar.bz2
> Installing ruby-2.6.7...
> ruby-build: using readline from homebrew
>
> BUILD FAILED (macOS 11.2.3 using ruby-build 20210420)
>
> Inspect or clean up the working tree at /var/folders/r0/vw984xf56318dq54dzjk26wm0000gn/T/ruby-build.20210421115228.39383.OiFuid
> Results logged to /var/folders/r0/vw984xf56318dq54dzjk26wm0000gn/T/ruby-build.20210421115228.39383.log
>
> Last 10 log lines:
> vm.c:2295:9: error: implicit declaration of function 'rb_native_mutex_destroy' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
>         rb_native_mutex_destroy(&vm->waitpid_lock);
>         ^
> vm.c:2489:34: warning: expression does not compute the number of elements in this array; element type is 'const int', not 'VALUE' (aka 'unsigned long') [-Wsizeof-array-div]
>                              sizeof(ec->machine.regs) / sizeof(VALUE));
>                                     ~~~~~~~~~~~~~~~~  ^
> vm.c:2489:34: note: place parentheses around the 'sizeof(VALUE)' expression to silence this warning
> 1 warning and 1 error generated.
> make: *** [vm.o] Error 1
> make: *** Waiting for unfinished jobs....
> ```
>
>
> ----------------------------------------
> Bug #17777: 2.6.7 fails to build on macOS: implicit declaration of function 'rb_native_mutex_destroy' is invalid in C99
> https://bugs.ruby-lang.org/issues/17777#change-91638
>
> * Author: Eregon (Benoit Daloze)
> * Status: Closed
> * Priority: Normal
> * ruby -v: 2.6.7
> * Backport: 2.6: REQUIRED, 2.7: DONTNEED, 3.0: DONTNEED
> ----------------------------------------
> https://github.com/ruby/ruby-builder/runs/2271346109?check_suite_focus=true#step:14:11253
> ```
> vm.c:2295:9: error: implicit declaration of function 'rb_native_mutex_destroy' is invalid in C99
> ```
>
> There is also a warning below that might be worth solving:
> ```
> vm.c:2489:34: warning: expression does not compute the number of elements in this array; element type is 'const int', not 'VALUE' (aka 'unsigned long') [-Wsizeof-array-div]
>                              sizeof(ec->machine.regs) / sizeof(VALUE));
>                                     ~~~~~~~~~~~~~~~~  ^
> vm.c:2489:34: note: place parentheses around the 'sizeof(VALUE)' expression to silence this warning
> ```
>
>
>
> --
> https://bugs.ruby-lang.org/
>
> Unsubscribe: <mailto:ruby-core-request@ruby-lang.org?subject=unsubscribe>
> <http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>



-- 
Austin Ziegler • halostatue@gmail.com • austin@halostatue.ca
http://www.halostatue.ca/http://twitter.com/halostatue

^ permalink raw reply	[flat|nested] 17+ messages in thread

* [ruby-core:103776] [Ruby master Bug#17777] 2.6.7 fails to build on macOS: implicit declaration of function 'rb_native_mutex_destroy' is invalid in C99
  2021-04-05 17:14 [ruby-core:103241] [Ruby master Bug#17777] 2.6.7 fails to build on macOS: implicit declaration of function 'rb_native_mutex_destroy' is invalid in C99 eregontp
                   ` (13 preceding siblings ...)
  2021-04-21  5:10 ` [ruby-core:103536] " tdehnke
@ 2021-05-09 16:13 ` usa
  14 siblings, 0 replies; 17+ messages in thread
From: usa @ 2021-05-09 16:13 UTC (permalink / raw)
  To: ruby-core

Issue #17777 has been updated by usa (Usaku NAKAMURA).

Backport changed from 2.6: REQUIRED, 2.7: DONTNEED, 3.0: DONTNEED to 2.6: DONE, 2.7: DONTNEED, 3.0: DONTNEED

(hopefully) fixed at r67942.

----------------------------------------
Bug #17777: 2.6.7 fails to build on macOS: implicit declaration of function 'rb_native_mutex_destroy' is invalid in C99
https://bugs.ruby-lang.org/issues/17777#change-91889

* Author: Eregon (Benoit Daloze)
* Status: Closed
* Priority: Normal
* ruby -v: 2.6.7
* Backport: 2.6: DONE, 2.7: DONTNEED, 3.0: DONTNEED
----------------------------------------
https://github.com/ruby/ruby-builder/runs/2271346109?check_suite_focus=true#step:14:11253
```
vm.c:2295:9: error: implicit declaration of function 'rb_native_mutex_destroy' is invalid in C99 
```

There is also a warning below that might be worth solving:
```
vm.c:2489:34: warning: expression does not compute the number of elements in this array; element type is 'const int', not 'VALUE' (aka 'unsigned long') [-Wsizeof-array-div]
                             sizeof(ec->machine.regs) / sizeof(VALUE));
                                    ~~~~~~~~~~~~~~~~  ^
vm.c:2489:34: note: place parentheses around the 'sizeof(VALUE)' expression to silence this warning
```



-- 
https://bugs.ruby-lang.org/

^ permalink raw reply	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2021-05-09 16:13 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-05 17:14 [ruby-core:103241] [Ruby master Bug#17777] 2.6.7 fails to build on macOS: implicit declaration of function 'rb_native_mutex_destroy' is invalid in C99 eregontp
2021-04-05 17:17 ` [ruby-core:103242] " chris
2021-04-05 17:19 ` [ruby-core:103243] " eregontp
2021-04-06  2:37 ` [ruby-core:103246] " usa
2021-04-06  6:20 ` [ruby-core:103249] " udzura
2021-04-06  9:46 ` [ruby-core:103252] " xtkoba+ruby
2021-04-06 23:47 ` [ruby-core:103259] " halostatue
2021-04-06 23:58 ` [ruby-core:103260] " halostatue
2021-04-07  0:00 ` [ruby-core:103261] " halostatue
2021-04-15 20:10 ` [ruby-core:103467] " halostatue
2021-04-16  5:25 ` [ruby-core:103471] " hsbt
2021-04-20 18:29 ` [ruby-core:103528] " tycho.braams
2021-04-20 19:13 ` [ruby-core:103530] " merch-redmine
2021-04-20 21:16 ` [ruby-core:103533] " tycho.braams
2021-04-21  5:10 ` [ruby-core:103536] " tdehnke
2021-04-21 16:18   ` [ruby-core:103542] " Austin Ziegler
2021-05-09 16:13 ` [ruby-core:103776] " usa

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).