Skip to content

Commit 26e55f0

Browse files
committed
fix compilation of 'executables'
1 parent f2b7b9f commit 26e55f0

File tree

1 file changed

+3
-3
lines changed
  • graalpython/com.oracle.graal.python.shell/src/com/oracle/graal/python/shell

1 file changed

+3
-3
lines changed

graalpython/com.oracle.graal.python.shell/src/com/oracle/graal/python/shell/GraalPythonCC.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ private void launchCC() {
181181

182182
if (link) {
183183
linkShared(fileInputs);
184-
if (!linkExecutable) {
184+
if (linkExecutable) {
185185
try {
186186
Path linkedBCfile = Files.move(Paths.get(outputFilename), Paths.get(bcFileFromFilename(outputFilename)), StandardCopyOption.REPLACE_EXISTING);
187187
linkExecutable(outputFilename, linkedBCfile.toString());
@@ -197,14 +197,14 @@ private static void linkExecutable(String executableScript, String linkedBcFile)
197197
cmdline.add("-LLI");
198198
cmdline.add(linkedBcFile);
199199
Path executablePath = Paths.get(executableScript);
200-
Files.write(executablePath, ("#!" + String.join(" ", cmdline)).getBytes());
200+
Files.write(executablePath, String.join(" ", cmdline).getBytes());
201201
HashSet<PosixFilePermission> perms = new HashSet<>(Arrays.asList(new PosixFilePermission[]{PosixFilePermission.OWNER_EXECUTE, PosixFilePermission.GROUP_EXECUTE}));
202202
perms.addAll(Files.getPosixFilePermissions(executablePath));
203203
Files.setPosixFilePermissions(executablePath, perms);
204204
}
205205

206206
private void linkShared(List<String> bitcodeFiles) {
207-
if (fileInputs.size() > 1) {
207+
if (fileInputs.size() > 0) {
208208
ArrayList<String> ldCmd = new ArrayList<>(bitcodeFiles);
209209
if (verbose) {
210210
ldCmd.add("-v");

0 commit comments

Comments
 (0)