mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-03-13 12:26:30 +00:00
Add NetBSD evbarm and fix segfault (#1384)
Some checks are pending
build / matrix_on_mode () (push) Waiting to run
build / matrix_on_mode (optlinux) (push) Waiting to run
build / matrix_on_mode (rel) (push) Waiting to run
build / matrix_on_mode (tiny) (push) Waiting to run
build / matrix_on_mode (tinylinux) (push) Waiting to run
Some checks are pending
build / matrix_on_mode () (push) Waiting to run
build / matrix_on_mode (optlinux) (push) Waiting to run
build / matrix_on_mode (rel) (push) Waiting to run
build / matrix_on_mode (tiny) (push) Waiting to run
build / matrix_on_mode (tinylinux) (push) Waiting to run
This change fixes a segmentation fault when comparing loaders that don't have a target kernel set. Additionally, adds evbarm, which is the output of uname -m on NetBSD on aarch64.
This commit is contained in:
parent
7b69652854
commit
a8ed4fdd09
1 changed files with 11 additions and 4 deletions
|
@ -1653,7 +1653,7 @@ static char *GenerateScriptIfLoaderMachine(char *p, struct Loader *loader) {
|
|||
if (loader->machine == EM_NEXGEN32E) {
|
||||
p = stpcpy(p, "if [ \"$m\" = x86_64 ] || [ \"$m\" = amd64 ]");
|
||||
} else if (loader->machine == EM_AARCH64) {
|
||||
p = stpcpy(p, "if [ \"$m\" = aarch64 ] || [ \"$m\" = arm64 ]");
|
||||
p = stpcpy(p, "if [ \"$m\" = aarch64 ] || [ \"$m\" = arm64 ] || [ \"$m\" = evbarm ]");
|
||||
} else if (loader->machine == EM_PPC64) {
|
||||
p = stpcpy(p, "if [ \"$m\" = ppc64le ]");
|
||||
} else if (loader->machine == EM_MIPS) {
|
||||
|
@ -1919,10 +1919,17 @@ int main(int argc, char *argv[]) {
|
|||
for (i = 0; i < loaders.n; ++i) {
|
||||
for (j = i + 1; j < loaders.n; ++j) {
|
||||
if (loaders.p[i].os == loaders.p[j].os &&
|
||||
loaders.p[i].machine == loaders.p[j].machine &&
|
||||
strcmp(loaders.p[i].kernel, loaders.p[j].kernel) == 0) {
|
||||
loaders.p[i].machine == loaders.p[j].machine) {
|
||||
if (!loaders.p[i].kernel && !loaders.p[j].kernel) {
|
||||
Die(prog, "multiple ape loaders specified for the same platform");
|
||||
}
|
||||
if (loaders.p[i].kernel != NULL &&
|
||||
loaders.p[j].kernel != NULL &&
|
||||
strcmp(loaders.p[i].kernel, loaders.p[j].kernel) == 0) {
|
||||
Die(prog, "multiple ape loaders specified for the same platform "
|
||||
"with matching kernels");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue