Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

parrot executable compiles, but miniparrot does not link. I need to s…

…ort out some issues with config hash initialization
  • Loading branch information...
commit 82cbd84b9ccd81b85fc2936e00bb69f78c68329d 1 parent 646bb72
@Whiteknight Whiteknight authored
View
1  compilers/imcc/main.c
@@ -585,6 +585,7 @@ compile_to_bytecode(PARROT_INTERP,
return pf;
}
+PARROT_API
int
imcc_run_api(ARGMOD(PMC * interp_pmc), ARGIN(const char *sourcefile), int argc,
ARGIN(const char **argv), ARGOUT(PMC **pbcpmc))
View
10 include/parrot/api.h
@@ -112,7 +112,7 @@ Parrot_Int Parrot_api_flag(
PARROT_API
Parrot_Int Parrot_api_get_last_error(
ARGMOD(PMC * interp_pmc),
- ARGOUT(Parrot_String ** errmsg))
+ ARGOUT(Parrot_String * errmsg))
__attribute__nonnull__(1)
__attribute__nonnull__(2)
FUNC_MODIFIES(* interp_pmc)
@@ -286,5 +286,13 @@ Parrot_Int Parrot_api_string_import_ascii(
/* Don't modify between HEADERIZER BEGIN / HEADERIZER END. Your changes will be lost. */
/* HEADERIZER END: src/embed/strings.c */
+/* Forward declaration because IMCC is still part of libparrot, but we don't
+ want to include parrot/imcc.h */
+
+PARROT_API
+int
+imcc_run_api(ARGMOD(Parrot_PMC interp_pmc), ARGIN(const char *sourcefile), int argc,
+ ARGIN(const char **argv), ARGOUT(PMC **pbcpmc));
+
#endif /* PARROT_API_H_GUARD */
View
29 src/embed/api.c
@@ -7,7 +7,7 @@
PARROT_API
Parrot_Int
-Parrot_api_get_last_error(ARGMOD(PMC * interp_pmc), ARGOUT(Parrot_String ** errmsg))
+Parrot_api_get_last_error(ARGMOD(PMC * interp_pmc), ARGOUT(Parrot_String * errmsg))
{
EMBED_API_CALLIN(interp_pmc, interp);
*errmsg = Parrot_str_new(interp, "Generic Error Message", 0);
@@ -21,24 +21,19 @@ Parrot_api_make_interpreter(ARGIN_NULLOK(PMC *parent), Parrot_Int flags, ARGIN_N
ASSERT_ARGS(Parrot_api_make_interpreter)
int alt_stacktop;
Parrot_Interp interp_raw;
- Parrot_Interp parent_raw;
void *stacktop_ptr = &alt_stacktop;
PMC * iglobals;
-
- Parrot_set_config_hash();
- {
- const Parrot_Interp parent_raw = PMC_IS_NULL(parent) ? NULL : GET_RAW_INTERP(parent);
- interp_raw = allocate_interpreter(parent_raw, flags);
- if (args) {
- if (args->stacktop)
- stacktop_ptr = args->stacktop;
- if (args->gc_system)
- Parrot_gc_set_system_type(interp_raw, args->gc_system);
- if (args->gc_threshold)
- interp_raw->gc_threshold = args->gc_threshold;
- if (args->hash_seed)
- interp_raw->hash_seed = args->hash_seed;
- }
+ const Parrot_Interp parent_raw = PMC_IS_NULL(parent) ? NULL : GET_RAW_INTERP(parent);
+ interp_raw = allocate_interpreter(parent_raw, flags);
+ if (args) {
+ if (args->stacktop)
+ stacktop_ptr = args->stacktop;
+ if (args->gc_system)
+ Parrot_gc_set_system_type(interp_raw, args->gc_system);
+ if (args->gc_threshold)
+ interp_raw->gc_threshold = args->gc_threshold;
+ if (args->hash_seed)
+ interp_raw->hash_seed = args->hash_seed;
}
initialize_interpreter(interp_raw, stacktop_ptr);
iglobals = interp_raw->iglobals;
View
3  src/longopt.c
@@ -134,7 +134,6 @@ longopt_get(int argc, ARGIN(const char* argv[]),
ARGIN(const struct longopt_opt_decl options[]),
ARGMOD(struct longopt_opt_info* info_buf))
{
- ASSERT_ARGS(longopt_get)
const int dex = info_buf->opt_index;
info_buf->opt_id = 0;
@@ -184,7 +183,6 @@ longopt_get_longopt(int argc, ARGIN(const char* argv[]),
ARGIN(const struct longopt_opt_decl options[]),
ARGMOD(struct longopt_opt_info* info_buf))
{
- ASSERT_ARGS(longopt_get_longopt)
const int dex = info_buf->opt_index;
int optlen = 0;
const struct longopt_opt_decl* dptr;
@@ -280,7 +278,6 @@ longopt_get_shortopt(int argc, ARGIN(const char* argv[]),
ARGIN(const struct longopt_opt_decl options[]),
ARGMOD(struct longopt_opt_info* info_buf))
{
- ASSERT_ARGS(longopt_get_shortopt)
const int dex = info_buf->opt_index;
const struct longopt_opt_decl* dptr;
const char* pos;
View
4 src/main.c
@@ -132,6 +132,8 @@ main(int argc, const char *argv[])
/* Parse minimal subset of flags */
parseflags_minimal(initargs, argc, argv);
+ Parrot_set_config_hash();
+
if (!(Parrot_api_make_interpreter(NULL, 0, initargs, &interp) &&
Parrot_api_set_executable_name(interp, argv[0]))) {
fprintf(stderr, "PARROT VM: Could not initialize new interpreter");
@@ -547,12 +549,14 @@ parseflags(Parrot_PMC interp,
break;
case OPT_GC_DEBUG:
+ /*
#if DISABLE_GC_DEBUG
//Parrot_warn(interp, PARROT_WARNINGS_ALL_FLAG,
Parrot_warn(interp, 0xFFFF,
"PARROT_GC_DEBUG is set but the binary was compiled "
"with DISABLE_GC_DEBUG.");
#endif
+ */
//Parrot_api_flag(interp, PARROT_GC_DEBUG_FLAG, 1);
Parrot_api_flag(interp, 0x10, 1);
break;

0 comments on commit 82cbd84

Please sign in to comment.
Something went wrong with that request. Please try again.