Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .build/k
Submodule k updated from 70cb72 to 665963
2 changes: 1 addition & 1 deletion Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ pipeline {
sh '''
eval $(opam config env)
eval $(perl -I "~/perl5/lib/perl5" -Mlocal::lib)
export KOMPILE_FLAGS=-O2
export KOMPILE_FLAGS=-O1
make -j4 profile-rule-parsing --output-sync=line
'''
} }
Expand Down
10 changes: 8 additions & 2 deletions scripts/kcc
Original file line number Diff line number Diff line change
Expand Up @@ -505,18 +505,24 @@ sub getLinkingCommand {
}
}
my $objText = join('', @objTexts);

my $one = chr((scalar @objTexts >> 24) & 0xff);
my $two = chr((scalar @objTexts >> 16) & 0xff);
my $three = chr((scalar @objTexts >> 8) & 0xff);
my $four = chr((scalar @objTexts >> 0) & 0xff);
$objText = MAGIC . "\x04\x00\x01$objText\x03$one$two$three$four\x07";

$objText = "$objText\x03$one$two$three$four";
$objText = "$objText\x02\x00\x00\x00\x00\x00\x00\x00\x0b\x00o\x00b\x00j\x00s\x00W\x00r\x00a\x00p\x00p\x00e\x00r\x00\x00\x00\x00\x01";
$objText = "$objText\x03\00\00\00\01";

$objText = MAGIC . "\x04\x00\x01$objText\x07";
open(my $file, '>', "$allObjsFile");
print $file $objText;
close $file;

@krun = addArg("OBJS", $allObjsFile, 'binaryfile', @krun);
} else {
@krun = addArg("OBJS", ".K", 'text', @krun);
@krun = addArg("OBJS", "objsWrapper(.K)", 'text', @krun);
}

@krun = addArg("PGM", ".K", 'text', @krun);
Expand Down
2 changes: 1 addition & 1 deletion semantics/c/language/common/common.k
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ require "check-use.k"
require "conversion.k"
require "dynamic.k"
require "error.k"
require "os-settings.k"
require "os-settings-syntax.k"
require "promotion.k"
require "settings.k"
require "symloc.k"
Expand Down
1 change: 1 addition & 0 deletions semantics/common/init.k
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ module COMMON-INIT-SYNTAX
syntax KItem ::= loadObj(K)
// this takes input from a file which is not split by thread, so we don't want to split this rule.
syntax KItem ::= unwrapObj(GeneratedTopCell) [function, noThread, symbol]
syntax KItem ::= objsWrapper(K) [symbol]

syntax CId ::= "mainArguments"

Expand Down
2 changes: 1 addition & 1 deletion semantics/linking/configuration.k
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ module C-CONFIGURATION

<exec>
<k color="green">
load($OBJS:K)
load($OBJS:KItem)
~> linkProgram(getEntryPoint($OPTIONS:Set))
~> cleanup
</k>
Expand Down
14 changes: 9 additions & 5 deletions semantics/linking/init.k
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ module LINKING-INIT-SYNTAX
imports BASIC-K
imports STRING-SYNTAX

syntax KItem ::= load(K) [symbol]
syntax KItem ::= load(KItem) [symbol]
syntax KItem ::= linkProgram(entrypoint: String)

endmodule
Expand Down Expand Up @@ -162,17 +162,21 @@ module LINKING-INIT
...</ns>)
...</namespaces>

rule load(Obj1:KItem ~> Obj2:KItem ~> Objs:K)
=> load(Objs ~> mergeObj(Obj1, Obj2))
syntax KItem ::= #load(K)

rule load(objsWrapper(K)) => #load(K)

rule #load(Obj1:KItem ~> Obj2:KItem ~> Objs:K)
=> #load(Objs ~> mergeObj(Obj1, Obj2))
~> checkMerge(Obj1, Obj2)

rule <k> load(Merged:KItem)
rule <k> #load(Merged:KItem)
=> loadObj(mergeObj(Merged, ThisObj))
~> checkMerge(Merged, ThisObj)
...</k>
ThisObj:GlobalCell

rule load(.K) => .K
rule #load(.K) => .K

syntax KItem ::= checkMerge(K, K)
rule checkMerge(_, .K) => .K
Expand Down