ignore TARGET environment variable (Makefiles tend to set that and confuse cparser)
[cparser] / driver / firm_machine.c
index ba05a4f..593e485 100644 (file)
@@ -16,12 +16,13 @@ static void set_be_option(const char *arg)
 
 static ir_entity *underscore_compilerlib_entity_creator(ident *id, ir_type *mt)
 {
-       ir_entity *ent    = new_entity(get_glob_type(), id, mt);
+       ir_entity *entity = new_entity(get_glob_type(), id, mt);
        ident     *ldname = id_mangle3("_", id, "");
 
-       set_entity_ld_ident(ent, ldname);
+       set_entity_visibility(entity, ir_visibility_external);
+       set_entity_ld_ident(entity, ldname);
 
-       return ent;
+       return entity;
 }
 
 /**
@@ -33,7 +34,7 @@ static bool setup_os_support(const char *os)
        if (strstr(os, "linux") != NULL || strstr(os, "bsd") != NULL
                        || streq(os, "solaris")) {
                set_be_option("ia32-gasmode=elf");
-       } else if (streq(os, "darwin")) {
+       } else if (strstart(os, "darwin")) {
                set_be_option("ia32-gasmode=macho");
                set_be_option("ia32-stackalign=4");
                set_be_option("pic=true");