Fix up some import and -fPIC stuff
This commit is contained in:
parent
c35e5a84b9
commit
c9889582a7
@ -1930,7 +1930,7 @@ CORD compile(env_t *env, ast_t *ast)
|
||||
else
|
||||
return Match(ast, InlineCCode)->code;
|
||||
}
|
||||
case Use: return CORD_EMPTY;
|
||||
case Use: code_err(ast, "Compiling 'use' as expression!");
|
||||
case LinkerDirective: code_err(ast, "Linker directives are not supported yet");
|
||||
case Extern: code_err(ast, "Externs are not supported as expressions");
|
||||
case TableEntry: code_err(ast, "Table entries should not be compiled directly");
|
||||
@ -2218,13 +2218,13 @@ module_code_t compile_file(ast_t *ast)
|
||||
if (!is_constant(env, decl->value))
|
||||
code_err(decl->value, "This value is not a valid constant initializer.");
|
||||
|
||||
if (is_private) {
|
||||
if (decl->value->tag == Use) {
|
||||
assert(compile_statement(env, stmt->ast) == CORD_EMPTY);
|
||||
} else if (is_private) {
|
||||
env->code->staticdefs = CORD_all(
|
||||
env->code->staticdefs,
|
||||
"static ", compile_type(env, t), " $", decl_name, " = ",
|
||||
compile(env, decl->value), ";\n");
|
||||
} else if (decl->value->tag == Use) {
|
||||
assert(compile_statement(env, stmt->ast) == CORD_EMPTY);
|
||||
} else {
|
||||
env->code->fndefs = CORD_all(
|
||||
env->code->fndefs,
|
||||
|
2
tomo.c
2
tomo.c
@ -97,7 +97,7 @@ int main(int argc, char *argv[])
|
||||
|
||||
cflags = getenv("CFLAGS");
|
||||
if (!cflags)
|
||||
cflags = heap_strf("%s %s -ggdb -I./include -D_DEFAULT_SOURCE", cconfig, optimization);
|
||||
cflags = heap_strf("%s %s -fPIC -ggdb -I./include -D_DEFAULT_SOURCE", cconfig, optimization);
|
||||
|
||||
ldflags = "-Wl,-rpath '-Wl,$ORIGIN' -L/usr/local/lib -L.";
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user