Skip to content

use comma for -rpath instead of equals sign to fix MacOS#1651

Merged
kripken merged 1 commit intoWebAssembly:masterfrom
jayphelps:rpath
Aug 30, 2018
Merged

use comma for -rpath instead of equals sign to fix MacOS#1651
kripken merged 1 commit intoWebAssembly:masterfrom
jayphelps:rpath

Conversation

@jayphelps
Copy link
Contributor

@jayphelps jayphelps commented Aug 29, 2018

on MacOS with gcc-8 the equals sign -rpath= is invalid. Best I can tell a comma can be used instead -rpath, more cross-platform, but only Travis will tell us 👍

I think this fixes #1185 provided you install real GCC (Mac has clang pretend to be gcc) and provide it CC=gcc-8 CXX=g++-8 ./check.py. If you can spare a few minutes to test @pepyakin to confirm?

@kripken
Copy link
Member

kripken commented Aug 29, 2018

Looks good on travis, and looks good to me too, thanks! But would be good to get confirmation from @pepyakin about the question above?

@pepyakin
Copy link
Contributor

pepyakin commented Aug 30, 2018

Yep, can confirm that it works! However, the ./check.py fails

Details
.. /Users/pepyakin/dev/etc/binaryen/test/lld/duplicate_imports.wast
executing:  bin/wasm-emscripten-finalize /Users/pepyakin/dev/etc/binaryen/test/lld/duplicate_imports.wast -S --global-base=568
incorrect output, diff:

--- /Users/pepyakin/dev/etc/binaryen/test/lld/duplicate_imports.wast.out
+++ actual
@@ -6,10 +6,16 @@
  (type $FUNCSIG$ij (func (param i64) (result i32)))
  (type $FUNCSIG$fifd (func (param i32 f32 f64) (result f32)))
  (type $FUNCSIG$fidd (func (param i32 f64 f64) (result f32)))
+ (type $legaltype$puts2 (func (param i32 i32) (result i32)))
+ (type $legaltype$invoke_ffd (func (param i32 f64 f64) (result f64)))
+ (type $legaltype$invoke_ffd2 (func (param i32 f64 f64) (result f64)))
  (import "env" "puts" (func $puts1 (param i32) (result i32)))
  (import "env" "puts" (func $puts2 (param i64) (result i32)))
  (import "env" "invoke_ffd" (func $invoke_ffd (param i32 f32 f64) (result f32)))
  (import "env" "invoke_ffd" (func $invoke_ffd2 (param i32 f64 f64) (result f32)))
+ (import "env" "puts" (func $legalimport$puts2 (param i32 i32) (result i32)))
+ (import "env" "invoke_ffd" (func $legalimport$invoke_ffd (param i32 f64 f64) (result f64)))
+ (import "env" "invoke_ffd" (func $legalimport$invoke_ffd2 (param i32 f64 f64) (result f64)))
  (global $global$0 (mut i32) (i32.const 66128))
  (global $global$1 i32 (i32.const 66128))
  (global $global$2 i32 (i32.const 581))
@@ -25,7 +31,7 @@
  (export "stackAlloc" (func $stackAlloc))
  (export "stackRestore" (func $stackRestore))
  (export "__growWasmMemory" (func $__growWasmMemory))
- (func $main (; 4 ;) (type $1) (result i32)
+ (func $main (; 7 ;) (type $1) (result i32)
   (drop
    (call $puts1
     (i32.const 568)
@@ -33,13 +39,46 @@
   )
   (i32.const 0)
  )
- (func $__wasm_call_ctors (; 5 ;) (type $2)
+ (func $__wasm_call_ctors (; 8 ;) (type $2)
   (nop)
  )
- (func $stackSave (; 6 ;) (result i32)
+ (func $legalfunc$puts2 (; 9 ;) (param $0 i64) (result i32)
+  (call $legalimport$puts2
+   (i32.wrap/i64
+    (get_local $0)
+   )
+   (i32.wrap/i64
+    (i64.shr_u
+     (get_local $0)
+     (i64.const 32)
+    )
+   )
+  )
+ )
+ (func $legalfunc$invoke_ffd (; 10 ;) (param $0 i32) (param $1 f32) (param $2 f64) (result f32)
+  (f32.demote/f64
+   (call $legalimport$invoke_ffd
+    (get_local $0)
+    (f64.promote/f32
+     (get_local $1)
+    )
+    (get_local $2)
+   )
+  )
+ )
+ (func $legalfunc$invoke_ffd2 (; 11 ;) (param $0 i32) (param $1 f64) (param $2 f64) (result f32)
+  (f32.demote/f64
+   (call $legalimport$invoke_ffd2
+    (get_local $0)
+    (get_local $1)
+    (get_local $2)
+   )
+  )
+ )
+ (func $stackSave (; 12 ;) (result i32)
   (get_global $global$0)
  )
- (func $stackAlloc (; 7 ;) (param $0 i32) (result i32)
+ (func $stackAlloc (; 13 ;) (param $0 i32) (result i32)
   (local $1 i32)
   (set_global $global$0
    (tee_local $1
@@ -54,12 +93,12 @@
   )
   (get_local $1)
  )
- (func $stackRestore (; 8 ;) (param $0 i32)
+ (func $stackRestore (; 14 ;) (param $0 i32)
   (set_global $global$0
    (get_local $0)
   )
  )
- (func $__growWasmMemory (; 9 ;) (param $newSize i32) (result i32)
+ (func $__growWasmMemory (; 15 ;) (param $newSize i32) (result i32)
   (grow_memory
    (get_local $newSize)
   )

Traceback (most recent call last):
  File "./check.py", line 675, in <module>
    sys.exit(main())
  File "./check.py", line 650, in main
    lld.test_wasm_emscripten_finalize()
  File "/Users/pepyakin/dev/etc/binaryen/scripts/test/lld.py", line 46, in test_wasm_emscripten_finalize
    fail_if_not_identical_to_file(actual, expected_file)
  File "/Users/pepyakin/dev/etc/binaryen/scripts/test/shared.py", line 315, in fail_if_not_identical_to_file
    fail_if_not_identical(actual, f.read(), fromfile=expected_file)
  File "/Users/pepyakin/dev/etc/binaryen/scripts/test/shared.py", line 305, in fail_if_not_identical
    fail(actual, expected, fromfile=fromfile)
  File "/Users/pepyakin/dev/etc/binaryen/scripts/test/shared.py", line 300, in fail
    fail_with_error("incorrect output, diff:\n\n%s" % diff_str)
  File "/Users/pepyakin/dev/etc/binaryen/scripts/test/shared.py", line 288, in fail_with_error
    raise Exception(msg)
Exception: incorrect output, diff:

--- /Users/pepyakin/dev/etc/binaryen/test/lld/duplicate_imports.wast.out
+++ actual
@@ -6,10 +6,16 @@
  (type $FUNCSIG$ij (func (param i64) (result i32)))
  (type $FUNCSIG$fifd (func (param i32 f32 f64) (result f32)))
  (type $FUNCSIG$fidd (func (param i32 f64 f64) (result f32)))
+ (type $legaltype$puts2 (func (param i32 i32) (result i32)))
+ (type $legaltype$invoke_ffd (func (param i32 f64 f64) (result f64)))
+ (type $legaltype$invoke_ffd2 (func (param i32 f64 f64) (result f64)))
  (import "env" "puts" (func $puts1 (param i32) (result i32)))
  (import "env" "puts" (func $puts2 (param i64) (result i32)))
  (import "env" "invoke_ffd" (func $invoke_ffd (param i32 f32 f64) (result f32)))
  (import "env" "invoke_ffd" (func $invoke_ffd2 (param i32 f64 f64) (result f32)))
+ (import "env" "puts" (func $legalimport$puts2 (param i32 i32) (result i32)))
+ (import "env" "invoke_ffd" (func $legalimport$invoke_ffd (param i32 f64 f64) (result f64)))
+ (import "env" "invoke_ffd" (func $legalimport$invoke_ffd2 (param i32 f64 f64) (result f64)))
  (global $global$0 (mut i32) (i32.const 66128))
  (global $global$1 i32 (i32.const 66128))
  (global $global$2 i32 (i32.const 581))
@@ -25,7 +31,7 @@
  (export "stackAlloc" (func $stackAlloc))
  (export "stackRestore" (func $stackRestore))
  (export "__growWasmMemory" (func $__growWasmMemory))
- (func $main (; 4 ;) (type $1) (result i32)
+ (func $main (; 7 ;) (type $1) (result i32)
   (drop
    (call $puts1
     (i32.const 568)
@@ -33,13 +39,46 @@
   )
   (i32.const 0)
  )
- (func $__wasm_call_ctors (; 5 ;) (type $2)
+ (func $__wasm_call_ctors (; 8 ;) (type $2)
   (nop)
  )
- (func $stackSave (; 6 ;) (result i32)
+ (func $legalfunc$puts2 (; 9 ;) (param $0 i64) (result i32)
+  (call $legalimport$puts2
+   (i32.wrap/i64
+    (get_local $0)
+   )
+   (i32.wrap/i64
+    (i64.shr_u
+     (get_local $0)
+     (i64.const 32)
+    )
+   )
+  )
+ )
+ (func $legalfunc$invoke_ffd (; 10 ;) (param $0 i32) (param $1 f32) (param $2 f64) (result f32)
+  (f32.demote/f64
+   (call $legalimport$invoke_ffd
+    (get_local $0)
+    (f64.promote/f32
+     (get_local $1)
+    )
+    (get_local $2)
+   )
+  )
+ )
+ (func $legalfunc$invoke_ffd2 (; 11 ;) (param $0 i32) (param $1 f64) (param $2 f64) (result f32)
+  (f32.demote/f64
+   (call $legalimport$invoke_ffd2
+    (get_local $0)
+    (get_local $1)
+    (get_local $2)
+   )
+  )
+ )
+ (func $stackSave (; 12 ;) (result i32)
   (get_global $global$0)
  )
- (func $stackAlloc (; 7 ;) (param $0 i32) (result i32)
+ (func $stackAlloc (; 13 ;) (param $0 i32) (result i32)
   (local $1 i32)
   (set_global $global$0
    (tee_local $1
@@ -54,12 +93,12 @@
   )
   (get_local $1)
  )
- (func $stackRestore (; 8 ;) (param $0 i32)
+ (func $stackRestore (; 14 ;) (param $0 i32)
   (set_global $global$0
    (get_local $0)
   )
  )
- (func $__growWasmMemory (; 9 ;) (param $newSize i32) (result i32)
+ (func $__growWasmMemory (; 15 ;) (param $newSize i32) (result i32)
   (grow_memory
    (get_local $newSize)
   )

@kripken
Copy link
Member

kripken commented Aug 30, 2018

Thanks @pepyakin! Ok, merging this. The check.py failure looks like something MacOS-specific that is separate from this, that we should an open an issue for.

@kripken kripken merged commit 6e80ade into WebAssembly:master Aug 30, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

check.py fails on macOS

3 participants