cs: repairs for Linux build
This commit is contained in:
parent
82517622c7
commit
69f5395d5d
|
@ -97,7 +97,7 @@ void racket_boot(int argc, char **argv, char *self, long segment_offset,
|
||||||
lseek(fd1, pos1, SEEK_SET);
|
lseek(fd1, pos1, SEEK_SET);
|
||||||
Sregister_boot_file_fd("petite", fd1);
|
Sregister_boot_file_fd("petite", fd1);
|
||||||
|
|
||||||
fd2 = open(self, O_RDONLY | O_BINARY);
|
fd2 = open(self, O_RDONLY | BOOT_O_BINARY);
|
||||||
lseek(fd2, pos2, SEEK_SET);
|
lseek(fd2, pos2, SEEK_SET);
|
||||||
Sregister_boot_file_fd("scheme", fd2);
|
Sregister_boot_file_fd("scheme", fd2);
|
||||||
}
|
}
|
||||||
|
|
|
@ -31,13 +31,21 @@
|
||||||
(add-racket-section src-file dest-file #".rackboot"
|
(add-racket-section src-file dest-file #".rackboot"
|
||||||
(lambda (pos)
|
(lambda (pos)
|
||||||
(values data 'any1 'any2))))
|
(values data 'any1 'any2))))
|
||||||
|
(define (ensure-executable dest-file)
|
||||||
|
(let* ([perms1 (file-or-directory-permissions dest-file 'bits)]
|
||||||
|
[perms2 (bitwise-ior user-read-bit user-write-bit user-execute-bit
|
||||||
|
perms1)])
|
||||||
|
(unless (equal? perms1 perms2)
|
||||||
|
(file-or-directory-permissions dest-file perms2))))
|
||||||
(cond
|
(cond
|
||||||
[start-pos
|
[start-pos
|
||||||
;; Success as ELF
|
;; Success as ELF
|
||||||
|
(ensure-executable dest-file)
|
||||||
start-pos]
|
start-pos]
|
||||||
[else
|
[else
|
||||||
;; Not ELF; just append to the end
|
;; Not ELF; just append to the end
|
||||||
(copy-file src-file dest-file #t)
|
(copy-file src-file dest-file #t)
|
||||||
|
(ensure-executable dest-file)
|
||||||
(define pos (file-size dest-file))
|
(define pos (file-size dest-file))
|
||||||
(call-with-output-file*
|
(call-with-output-file*
|
||||||
dest-file
|
dest-file
|
||||||
|
|
Loading…
Reference in New Issue
Block a user