Skip to content

Commit f590030

Browse files
committed
Use static link for compare scripts
In case you have different GLIBC versions inside and outside of the chroot we would get errors. As dynamic linking saves a bit of space we shouldn't always do this but as we only do this for compare scripts and not the submissions this is quite a small diskoverhead.
1 parent e45daf5 commit f590030

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

judge/judgedaemon.main.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -463,10 +463,10 @@ function fetch_executable_internal(
463463
}
464464
switch ($execlang) {
465465
case 'c':
466-
$buildscript .= "gcc -Wall -O2 -std=gnu11 $source -o run -lm\n";
466+
$buildscript .= "gcc -Wall -O2 -static -std=gnu11 $source -o run -lm\n";
467467
break;
468468
case 'cpp':
469-
$buildscript .= "g++ -Wall -O2 -std=gnu++20 $source -o run\n";
469+
$buildscript .= "g++ -Wall -O2 -static -std=gnu++20 $source -o run\n";
470470
break;
471471
case 'java':
472472
$buildscript .= "javac -cp . -d . $source\n";
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
#!/bin/sh
2-
g++ -std=c++11 -pedantic -g -O1 -Wall -fstack-protector -D_FORTIFY_SOURCE=2 -fPIE -Wformat -Wformat-security -fPIE -Wl,-z,relro -Wl,-z,now compare.cc -o run
2+
g++ -std=c++11 -pedantic -g -O1 -static -Wall -fstack-protector -D_FORTIFY_SOURCE=2 -fPIE -Wformat -Wformat-security -fPIE -Wl,-z,relro -Wl,-z,now compare.cc -o run

0 commit comments

Comments
 (0)