Skip to content

New spirv#2276

Merged
thewilsonator merged 12 commits intoldc-developers:masterfrom
thewilsonator:new-spirv
Aug 18, 2017
Merged

New spirv#2276
thewilsonator merged 12 commits intoldc-developers:masterfrom
thewilsonator:new-spirv

Conversation

@thewilsonator
Copy link
Contributor

No description provided.

@kinke
Copy link
Member

kinke commented Aug 15, 2017

The path of the 'root' dir inside the archive is ./_CPack_Packages/Darwin/TBZ2/LLVM-6.0.0git-18708be-Darwin, but should be LLVM-6.0.0 an arbitrarily named non-nested dir.

@thewilsonator
Copy link
Contributor Author

Ah, I ran tar -c ./_CPack_Packages/Darwin/TBZ2/LLVM-6.0.0git-18708be-Darwin | bzip2 -9 > ./_CPack_Packages/Darwin/TBZ2/LLVM-6.0.0git-18708be-Darwin.tar.bz2 from the llvm build directory instead of cding into ./_CPack_Packages/Darwin/TBZ2 and then running tar. It is very annoying that libFuzzer.ais not copied properly by cpack.

Will reupload tomorrow morning.

@thewilsonator
Copy link
Contributor Author

Hmm it does not find llvm-config? It definitely there.

@kinke
Copy link
Member

kinke commented Aug 16, 2017

Most likely because of this missing 6.0 (and other future versions). Stumbled upon this yesterday.

@thewilsonator
Copy link
Contributor Author

Hmm, still does not work.

@kinke
Copy link
Member

kinke commented Aug 16, 2017

You've used ./llvm-.... Try repackaging without . (or simply try the extraction command locally before uploading ;)).

#else
cl::init(llvm::CodeModel::Small),
clEnumValues(
#endif
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We shouldn't enforce CodeModel::Small.
The better solution is what LLVM does:

+cl::opt<llvm::CodeModel::Model> CMModel(
+    "code-model", cl::desc("Choose code model"),
+    cl::values(clEnumValN(CodeModel::Small, "small", "Small code model"),
+               clEnumValN(CodeModel::Kernel, "kernel", "Kernel code model"),
+               clEnumValN(CodeModel::Medium, "medium", "Medium code model"),
+               clEnumValN(CodeModel::Large, "large", "Large code model")));
+
+static inline Optional<CodeModel::Model> getCodeModel() {
+  if (CMModel.getNumOccurrences()) {
+    CodeModel::Model M = CMModel;
+    return M;
+  }
+  return None;
+}

mCodeModel should be made private and the getCodeModel function should be added.
Same as getRelocModel (misplaced in main.cpp)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will do. Ill just make sure this works.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will all be superseded by #2148 anyway.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Alright I'll leave it for #2148.

@thewilsonator
Copy link
Contributor Author

Hmm, it timed out downloading LLVM. Closing/reopening.

@thewilsonator
Copy link
Contributor Author

Dammit, I forgot to copy across libFuzzer.a. Is there a way to get it to do that automatically with cpack?

@thewilsonator
Copy link
Contributor Author

A few sanitiser fuzz tests fail. Some due to missing line info:

/Users/nicholaswilson/d/ldc/tests/sanitizers/asan_interface.d:26:17: error: expected string not found in input
 // CHECK-NEXT: #0 {{.*}} in {{.*getX.*}} {{.*}}asan_interface.d:[[@LINE+1]]
                ^
<stdin>:3:16: note: scanning from here
READ of size 4 at 0x00010b523704 thread T0
               ^
<stdin>:3:16: note: with expression "@LINE+1" equal to "27"
READ of size 4 at 0x00010b523704 thread T0
               ^
<stdin>:4:78: note: possible intended match here
 #0 0x1078bf83f in _D14asan_interface4getXFZi (/Users/nicholaswilson/d/ldcbuild/tests/sanitizers/Output/asan_interface.d.tmp:x86_64+0x10000183f)

Others fail to link

$ "/Users/nicholaswilson/d/ldcbuild/bin/ldc2" "-g" "-fsanitize=fuzzer" "/Users/nicholaswilson/d/ldc/tests/sanitizers/fuzz_basic.d" "-of=/Users/nicholaswilson/d/ldcbuild/tests/sanitizers/Output/fuzz_basic.d.tmp"
# command stderr:
Undefined symbols for architecture x86_64:
  "___sanitizer_cov_trace_const_cmp1", referenced from:
      _LLVMFuzzerTestOneInput in fuzz_basic.d.o
  "___sanitizer_cov_trace_const_cmp4", referenced from:
      __D10fuzz_basic6FuzzMeFxPhmZv in fuzz_basic.d.o
  "___sanitizer_cov_trace_const_cmp8", referenced from:
      __D10fuzz_basic6FuzzMeFxPhmZv in fuzz_basic.d.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Error: /usr/bin/gcc failed with status: 1

The other failure is

/Users/nicholaswilson/d/ldc/tests/sanitizers/fsanitize_fuzzer.d:13:12: error: expected string not found in input
 // CHECK: call {{.*}}_sanitizer_cov_trace_cmp
           ^
<stdin>:32:43: note: scanning from here
 call void @__sanitizer_cov_trace_pc_guard(i32* getelementptr inbounds ([6 x i32], [6 x i32]* @__sancov_gen_, i32 0, i32 0))
                                          ^
<stdin>:34:2: note: possible intended match here
 call void @__sanitizer_cov_trace_const_cmp8(i64 2, i64 %dataSize_arg)
 ^

error: command failed with exit status: 1

@thewilsonator
Copy link
Contributor Author

Merging this so that testing and development can continue

@thewilsonator thewilsonator merged commit f27109c into ldc-developers:master Aug 18, 2017
@JohanEngelen
Copy link
Member

@thewilsonator The link failure is likely due to versions not being up to date (LLVM vs. libFuzzer.a). Did you svn update projects/compiler-rt too? In any case, just remove libFuzzer.a from the package for now. It's already more than enough pain to be testing LLVM trunk on Travis because it is failing so often.

@thewilsonator
Copy link
Contributor Author

OK.

@JohanEngelen
Copy link
Member

(libFuzzer was moved to compiler-rt, so for LLVM >= 6 we need to look for it in the same place as the sanitizer libs. Perhaps the version problem happened because you had an old libFuzzer lying around in the old location from a build before the move happened)

@kinke
Copy link
Member

kinke commented Aug 23, 2017

A new libfuzzer test also fails for LLVM 5.0 on Circle: sanitizers/fuzz_basic.d, see https://circleci.com/gh/ldc-developers/ldc/3051.

@JohanEngelen
Copy link
Member

That's a sporadic error, let me know if it happens again, I will simplify the test.

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.

3 participants