summaryrefslogtreecommitdiff
authorPekka Paalanen <ppaalanen@gmail.com>2012-08-22 07:02:07 (GMT)
committer Pekka Paalanen <ppaalanen@gmail.com>2012-08-22 07:12:37 (GMT)
commit056e8096a2b6598252363295fe52e3a15a4afa33 (patch) (side-by-side diff)
tree338a77a8e1066a4fda55a0ea7bbfc4e07004a65e
parent04d160c28429a91821db5ffea6473cfde5912842 (diff)
downloadandrogenizer-056e8096a2b6598252363295fe52e3a15a4afa33.tar.gz
androgenizer-056e8096a2b6598252363295fe52e3a15a4afa33.tar.bz2
ldflags: handle -R and -L with ldflag_actionpq
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--library.c22
-rw-r--r--options.c8
2 files changed, 15 insertions, 15 deletions
diff --git a/library.c b/library.c
index 3517b56..0c668d3 100644
--- a/library.c
+++ b/library.c
@@ -48,6 +48,7 @@ enum library_type library_scope(char *name)
enum flag_arg {
FLAG_ARG_NO,
FLAG_ARG_YES,
+ FLAG_ARG_JOINED,
};
struct flag_exclusion {
@@ -62,6 +63,8 @@ static const struct flag_exclusion dropped_ldflags[] = {
{ "-no-undefined", FLAG_ARG_NO },
{ "-dlopen", FLAG_ARG_YES },
{ "-version-info", FLAG_ARG_YES },
+ { "-L", FLAG_ARG_JOINED },
+ { "-R", FLAG_ARG_JOINED },
{ NULL, 0 }
};
@@ -70,19 +73,24 @@ enum flag_action ldflag_action(const char *flag)
const struct flag_exclusion *fe;
for (fe = &dropped_ldflags[0]; fe->name; fe++) {
- if (strcmp(flag, fe->name) != 0)
- continue;
+ if (fe->arg == FLAG_ARG_JOINED) {
+ if (strncmp(flag, fe->name, strlen(fe->name)) != 0)
+ continue;
+ } else {
+ if (strcmp(flag, fe->name) != 0)
+ continue;
+ }
switch (fe->arg) {
case FLAG_ARG_NO:
return FLAG_SKIP;
case FLAG_ARG_YES:
return FLAG_SKIP_WITH_ARG;
- /* case FLAG_ARG_JOINED:
- If an argument is immediately in this flag,
- return FLAG_SKIP, otherwise there must be
- an argument as the next word, so return
- FLAG_SKIP_WITH_ARG. */
+ case FLAG_ARG_JOINED:
+ if (strlen(flag) == strlen(fe->name))
+ return FLAG_SKIP_WITH_ARG;
+ else
+ return FLAG_SKIP;
}
}
diff --git a/options.c b/options.c
index 0820beb..c2f543b 100644
--- a/options.c
+++ b/options.c
@@ -384,14 +384,6 @@ static int add_ldflag(struct module *m, char *flag, enum build_type btype)
}
if (flag[0] == '-') {
- if (flag[1] == 'L') {
- free(flag);
- return 0;
- }
- if (flag[1] == 'R') {
- free(flag);
- return 0;
- }
action = ldflag_action(flag);
if (action == FLAG_SKIP) {
free(flag);