bake-toolkit 2.64.0 → 2.65.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/bake/toolchain/clang_bitcode.rb +34 -0
- data/lib/bake/toolchain/provider.rb +2 -0
- data/lib/blocks/block.rb +1 -0
- data/lib/blocks/compile.rb +10 -5
- data/lib/blocks/executable.rb +9 -3
- data/lib/blocks/library.rb +4 -1
- data/lib/common/version.rb +1 -1
- data/lib/tocxx.rb +12 -11
- metadata +7 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8fd56c91721f565baebab8ee13b453249a1673565cccd22ddde5787797035562
|
4
|
+
data.tar.gz: d6013cd8ad4eefe6f6979d2b3a905a30b1737b54398c7d317367bc9a36676e71
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4d360c2a3d60a572580ab81ab31575d330b69aa7001b09a3dd725e88e23c5bb3a7e34564d1933e8c68c680fea831eeec63c829f63e1cd5307079c319ef68ce09
|
7
|
+
data.tar.gz: 3190bf643083cd2378eec6b3a69077e17fe80c2f8f05080e80903306132c362c52dbea7ab834f5a8815eff1916b8b4689780ab863a9f93dbcce14f6dfd05b7da
|
@@ -0,0 +1,34 @@
|
|
1
|
+
require_relative'../../common/utils'
|
2
|
+
require_relative '../toolchain/provider'
|
3
|
+
require_relative '../toolchain/errorparser/error_parser'
|
4
|
+
require_relative '../toolchain/errorparser/gcc_compiler_error_parser'
|
5
|
+
require_relative '../toolchain/errorparser/gcc_linker_error_parser'
|
6
|
+
|
7
|
+
module Bake
|
8
|
+
module Toolchain
|
9
|
+
CLANG_BITCODE_CHAIN = Provider.add("CLANG_BITCODE")
|
10
|
+
|
11
|
+
CLANG_BITCODE_CHAIN[:COMPILER][:CPP].update({
|
12
|
+
:COMMAND => "clang++",
|
13
|
+
:DEFINE_FLAG => "-D",
|
14
|
+
:OBJECT_FILE_FLAG => "-o",
|
15
|
+
:OBJ_FLAG_SPACE => true,
|
16
|
+
:OBJECT_FILE_ENDING => ".bc",
|
17
|
+
:COMPILE_FLAGS => "-emit-llvm -c ",
|
18
|
+
:ERROR_PARSER => nil,
|
19
|
+
:DEP_FLAGS => "-MD -MF",
|
20
|
+
:DEP_FLAGS_SPACE => true,
|
21
|
+
})
|
22
|
+
|
23
|
+
CLANG_BITCODE_CHAIN[:COMPILER][:C] = Utils.deep_copy(CLANG_BITCODE_CHAIN[:COMPILER][:CPP])
|
24
|
+
CLANG_BITCODE_CHAIN[:COMPILER][:C][:SOURCE_FILE_ENDINGS] = Provider.default[:COMPILER][:C][:SOURCE_FILE_ENDINGS]
|
25
|
+
CLANG_BITCODE_CHAIN[:COMPILER][:C][:COMMAND] = "clang"
|
26
|
+
|
27
|
+
CLANG_BITCODE_CHAIN[:ARCHIVER][:COMMAND] = "llvm-link"
|
28
|
+
CLANG_BITCODE_CHAIN[:ARCHIVER][:ARCHIVE_FLAGS] = "-o"
|
29
|
+
CLANG_BITCODE_CHAIN[:ARCHIVER][:ARCHIVE_FILE_ENDING] = ".bc"
|
30
|
+
|
31
|
+
CLANG_BITCODE_CHAIN[:LINKER][:COMMAND] = "llvm-link"
|
32
|
+
CLANG_BITCODE_CHAIN[:LINKER][:EXE_FLAG] = "-o"
|
33
|
+
end
|
34
|
+
end
|
@@ -88,6 +88,7 @@ module Bake
|
|
88
88
|
:PREFIX => "$(ArchiverPrefix)",
|
89
89
|
:ARCHIVE_FLAGS => "",
|
90
90
|
:ARCHIVE_FLAGS_SPACE => true,
|
91
|
+
:ARCHIVE_FILE_ENDING => ".a",
|
91
92
|
:FLAGS => "",
|
92
93
|
:ERROR_PARSER => nil,
|
93
94
|
:FILE_COMMAND => ""
|
@@ -163,6 +164,7 @@ require_relative '../toolchain/diab'
|
|
163
164
|
require_relative '../toolchain/gcc'
|
164
165
|
require_relative '../toolchain/clang'
|
165
166
|
require_relative '../toolchain/clang_analyze'
|
167
|
+
require_relative '../toolchain/clang_bitcode'
|
166
168
|
require_relative '../toolchain/ti'
|
167
169
|
require_relative '../toolchain/greenhills'
|
168
170
|
require_relative '../toolchain/keil'
|
data/lib/blocks/block.rb
CHANGED
data/lib/blocks/compile.rb
CHANGED
@@ -52,7 +52,7 @@ module Bake
|
|
52
52
|
|
53
53
|
class Compile < BlockBase
|
54
54
|
|
55
|
-
attr_reader :objects, :source_files, :include_list, :source_files_ignored_in_lib, :object_files_ignored_in_lib
|
55
|
+
attr_reader :objects, :source_files, :source_files_compiled, :include_list, :source_files_ignored_in_lib, :object_files_ignored_in_lib, :object_files
|
56
56
|
|
57
57
|
def mutex
|
58
58
|
@mutex ||= Mutex.new
|
@@ -133,14 +133,18 @@ module Bake
|
|
133
133
|
return false
|
134
134
|
end
|
135
135
|
|
136
|
+
def calcObjectBasename(object)
|
137
|
+
object.chomp(File.extname(object))
|
138
|
+
end
|
139
|
+
|
136
140
|
def calcCmdlineFile(object)
|
137
|
-
File.expand_path(object
|
141
|
+
File.expand_path(calcObjectBasename(object) + ".cmdline", @projectDir)
|
138
142
|
end
|
139
143
|
|
140
144
|
def calcDepFile(object, type)
|
141
145
|
dep_filename = nil
|
142
146
|
if type != :ASM
|
143
|
-
dep_filename = object
|
147
|
+
dep_filename = calcObjectBasename(object) + ".d"
|
144
148
|
end
|
145
149
|
dep_filename
|
146
150
|
end
|
@@ -426,6 +430,7 @@ module Bake
|
|
426
430
|
Utils.gitIgnore(odir) if !Bake.options.dry
|
427
431
|
|
428
432
|
fileListBlock = Set.new if Bake.options.filelist
|
433
|
+
@source_files_compiled = @source_files.dup
|
429
434
|
compileJobs = Multithread::Jobs.new(@source_files) do |jobs|
|
430
435
|
while source = jobs.get_next_or_nil do
|
431
436
|
|
@@ -544,7 +549,7 @@ module Bake
|
|
544
549
|
end
|
545
550
|
|
546
551
|
def calcSources(cleaning = false, keep = false)
|
547
|
-
return @source_files if @source_files
|
552
|
+
return @source_files if @source_files && !@source_files.empty?
|
548
553
|
@source_files = []
|
549
554
|
@source_files_ignored_in_lib = []
|
550
555
|
@source_files_link_directly = []
|
@@ -560,7 +565,7 @@ module Bake
|
|
560
565
|
pr = sources.name
|
561
566
|
pr = pr[2..-1] if pr.start_with?"./"
|
562
567
|
|
563
|
-
res = Dir.glob_dir(pr, @projectDir).sort
|
568
|
+
res = Dir.glob_dir(pr, @projectDir).select {|f| !get_source_type(f).nil?}.sort
|
564
569
|
if res.length == 0 and cleaning == false
|
565
570
|
if not pr.include?"*" and not pr.include?"?"
|
566
571
|
Bake.formatter.printError("Source file '#{pr}' not found", sources)
|
data/lib/blocks/executable.rb
CHANGED
@@ -190,9 +190,15 @@ module Bake
|
|
190
190
|
BlockBase.writeCmdLineFile(cmd, cmdLineFile)
|
191
191
|
success = true
|
192
192
|
consoleOutput = ""
|
193
|
-
|
194
|
-
|
195
|
-
|
193
|
+
retry_linking = Bake.options.dev_features.include?("retry-linking") ? 5 : 1
|
194
|
+
begin
|
195
|
+
success, consoleOutput = ProcessHelper.run(realCmd, false, false, outPipe) if !Bake.options.dry
|
196
|
+
process_result(cmdLinePrint, consoleOutput, linker[:ERROR_PARSER], nil, reason, success)
|
197
|
+
rescue Exception
|
198
|
+
retry_linking -= 1
|
199
|
+
retry if !success && retry_linking > 0
|
200
|
+
raise
|
201
|
+
end
|
196
202
|
check_config_file()
|
197
203
|
end
|
198
204
|
|
data/lib/blocks/library.rb
CHANGED
@@ -18,10 +18,13 @@ module Bake
|
|
18
18
|
end
|
19
19
|
|
20
20
|
def calcArtifactName
|
21
|
+
archiver = @block.tcs[:ARCHIVER]
|
22
|
+
fileEnding = archiver[:ARCHIVE_FILE_ENDING]
|
23
|
+
|
21
24
|
if not @config.artifactName.nil? and @config.artifactName.name != ""
|
22
25
|
baseFilename = @config.artifactName.name
|
23
26
|
else
|
24
|
-
baseFilename = "lib#{@projectName}
|
27
|
+
baseFilename = "lib#{@projectName}#{fileEnding}"
|
25
28
|
end
|
26
29
|
if !@config.artifactExtension.nil? && @config.artifactExtension.name != "default"
|
27
30
|
extension = ".#{@config.artifactExtension.name}"
|
data/lib/common/version.rb
CHANGED
data/lib/tocxx.rb
CHANGED
@@ -859,6 +859,7 @@ module Bake
|
|
859
859
|
!Bake.options.linkOnly &&
|
860
860
|
!Bake.options.prepro &&
|
861
861
|
!Bake.options.compileOnly &&
|
862
|
+
!Bake.options.dry &&
|
862
863
|
!Bake.options.clean
|
863
864
|
|
864
865
|
ccChecks = []
|
@@ -885,19 +886,18 @@ module Bake
|
|
885
886
|
inCompilation = Set.new
|
886
887
|
Blocks::ALL_BLOCKS.each do |name,block|
|
887
888
|
block.mainSteps.each do |b|
|
888
|
-
if Blocks::Compile === b
|
889
|
-
b.
|
889
|
+
if Blocks::Compile === b && !b.source_files_compiled.nil?
|
890
|
+
b.source_files_compiled.each do |s|
|
890
891
|
inCompilation << File.expand_path(s, b.projectDir)
|
891
892
|
type = b.get_source_type(s)
|
892
|
-
if type != :ASM
|
893
|
-
b.
|
894
|
-
|
895
|
-
|
896
|
-
|
897
|
-
|
898
|
-
|
899
|
-
|
900
|
-
end
|
893
|
+
if type != :ASM && b.object_files && b.object_files.has_key?(s)
|
894
|
+
o = b.object_files[s]
|
895
|
+
dep_filename = b.calcDepFile(o, type)
|
896
|
+
dep_filename_conv = b.calcDepFileConv(dep_filename)
|
897
|
+
File.readlines(File.expand_path(dep_filename_conv, b.projectDir)).map{|line| line.strip}.each do |dep|
|
898
|
+
header = File.expand_path(dep, b.projectDir)
|
899
|
+
if File.exist?(header)
|
900
|
+
inCompilation << header
|
901
901
|
end
|
902
902
|
end
|
903
903
|
end
|
@@ -905,6 +905,7 @@ module Bake
|
|
905
905
|
end
|
906
906
|
end
|
907
907
|
end
|
908
|
+
|
908
909
|
pnPwd = Pathname.new(Dir.pwd)
|
909
910
|
ccNotIncluded = (ccIncludes - inCompilation).to_a
|
910
911
|
ccNotExcluded = inCompilation.select {|i| ccExcludes.include?(i) }
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bake-toolkit
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.65.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Alexander Schaal
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-08-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rtext
|
@@ -84,16 +84,16 @@ dependencies:
|
|
84
84
|
name: thwait
|
85
85
|
requirement: !ruby/object:Gem::Requirement
|
86
86
|
requirements:
|
87
|
-
- -
|
87
|
+
- - '='
|
88
88
|
- !ruby/object:Gem::Version
|
89
|
-
version:
|
89
|
+
version: 0.1.0
|
90
90
|
type: :runtime
|
91
91
|
prerelease: false
|
92
92
|
version_requirements: !ruby/object:Gem::Requirement
|
93
93
|
requirements:
|
94
|
-
- -
|
94
|
+
- - '='
|
95
95
|
- !ruby/object:Gem::Version
|
96
|
-
version:
|
96
|
+
version: 0.1.0
|
97
97
|
- !ruby/object:Gem::Dependency
|
98
98
|
name: e2mmap
|
99
99
|
requirement: !ruby/object:Gem::Requirement
|
@@ -204,6 +204,7 @@ files:
|
|
204
204
|
- lib/bake/subst.rb
|
205
205
|
- lib/bake/toolchain/clang.rb
|
206
206
|
- lib/bake/toolchain/clang_analyze.rb
|
207
|
+
- lib/bake/toolchain/clang_bitcode.rb
|
207
208
|
- lib/bake/toolchain/colorizing_formatter.rb
|
208
209
|
- lib/bake/toolchain/diab.rb
|
209
210
|
- lib/bake/toolchain/errorparser/diab_compiler_error_parser.rb
|