mirror of
https://github.com/apache/nuttx.git
synced 2026-05-27 11:26:12 +08:00
ZDS-II Object file relocations
tools/zds/zdsgen.c: Remove this program. It should have been a simpler way to manage ZDS-II compiler and assember differences. However, the compiler arguments needed to pass through too many layers of bash command line modifications and, as a result, it was not possible to retain quotes on critical strings. This approch was abandoned for an alternative approach. boards/z80/ez80/scripts/eZ80_Config.mk: Add definitions to move the object files as necessary. This seems to work well and is implemented for both native and Cygwin Windows build -- but only for the Z20x.
This commit is contained in:
committed by
Alan Carvalho de Assis
parent
d74ca3ab82
commit
75be4c5677
+1
-6
@@ -50,7 +50,7 @@ endif
|
||||
|
||||
# Targets
|
||||
|
||||
all: zdsar.exe zdsgen.exe
|
||||
all: zdsar.exe
|
||||
default: all
|
||||
.PHONY: clean
|
||||
|
||||
@@ -64,11 +64,6 @@ CFLAGS += -DHAVE_STRTOK_C=1
|
||||
zdsar.exe: zdsar.c
|
||||
$(Q) $(HOSTCC) $(HOSTCFLAGS) -o zdsar.exe zdsar.c
|
||||
|
||||
# zdsgen - Wrapper for the ZDS-II compiler and assembler
|
||||
|
||||
zdsgen.exe: zdsgen.c
|
||||
$(Q) $(HOSTCC) $(HOSTCFLAGS) -o zdsgen.exe zdsgen.c
|
||||
|
||||
clean:
|
||||
@rm -f *.o *.a *.dSYM *~ .*.swp
|
||||
@rm -f zdsar zdsar.exe
|
||||
|
||||
@@ -7,5 +7,6 @@ tools/zds/zdsar.c: This is a wrapper around the ZDS_II librarian. It
|
||||
the build files but it also improves performance and, more importantly,i
|
||||
provides a common solution for the Windows native build case.
|
||||
|
||||
This tool should work with all ZDS-II based platforms including z8, zNeo, and ez80.
|
||||
These tools should work with all ZDS-II based platforms including z8, zNeo,
|
||||
and ez80.
|
||||
|
||||
|
||||
+12
-12
@@ -115,7 +115,7 @@ static char g_initial_wd[MAX_PATH]; /* Initial working directory */
|
||||
static char g_path[MAX_PATH]; /* Buffer for expanding paths */
|
||||
static char g_objpath[MAX_PATH]; /* Temporary for path generation */
|
||||
#ifdef HOST_CYGWIN
|
||||
static char g_expand[MAX_EXPAND]; /* Temporary for expanded path */
|
||||
static char g_expand[MAX_EXPAND]; /* Temporary for quoted path */
|
||||
static char g_dequoted[MAX_PATH]; /* Temporary for de-quoted path */
|
||||
static char g_hostpath[MAX_PATH]; /* Temporary for host path conversions */
|
||||
#endif
|
||||
@@ -231,7 +231,7 @@ static void append(char **base, char *str)
|
||||
*base = newbase;
|
||||
}
|
||||
|
||||
static const char *do_expand(const char *argument)
|
||||
static const char *quote_backslash(const char *argument)
|
||||
{
|
||||
#ifdef HOST_CYGWIN
|
||||
const char *src;
|
||||
@@ -254,7 +254,7 @@ static const char *do_expand(const char *argument)
|
||||
break;
|
||||
}
|
||||
|
||||
/* Already expanded? */
|
||||
/* Already quoted? */
|
||||
|
||||
if (*src == '\\')
|
||||
{
|
||||
@@ -767,10 +767,10 @@ static void do_archive(void)
|
||||
|
||||
if (g_arflags != NULL)
|
||||
{
|
||||
const char *expanded;
|
||||
const char *quoted;
|
||||
|
||||
expanded = do_expand(g_arflags);
|
||||
cmdlen += strlen(expanded);
|
||||
quoted = quote_backslash(g_arflags);
|
||||
cmdlen += strlen(quoted);
|
||||
|
||||
if (cmdlen >= MAX_BUFFER)
|
||||
{
|
||||
@@ -779,7 +779,7 @@ static void do_archive(void)
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
strcat(g_command, expanded);
|
||||
strcat(g_command, quoted);
|
||||
}
|
||||
|
||||
/* Add each object file. This loop will continue until each path has been
|
||||
@@ -789,7 +789,7 @@ static void do_archive(void)
|
||||
nobjects = 0;
|
||||
while ((object = strtok_r(objects, " ", &lasts)) != NULL)
|
||||
{
|
||||
const char *expanded;
|
||||
const char *quoted;
|
||||
const char *converted;
|
||||
|
||||
/* Set objects to NULL. This will force strtok_r to move from the
|
||||
@@ -887,8 +887,8 @@ static void do_archive(void)
|
||||
|
||||
pathlen = 4; /* For =-+ and terminator */
|
||||
|
||||
expanded = do_expand(g_path);
|
||||
pathlen += strlen(expanded);
|
||||
quoted = quote_backslash(g_path);
|
||||
pathlen += strlen(quoted);
|
||||
|
||||
/* Get the full length */
|
||||
|
||||
@@ -899,14 +899,14 @@ static void do_archive(void)
|
||||
{
|
||||
fprintf(stderr, "ERROR: object argument is too long [%d/%d]: "
|
||||
"%s=-+%s\n",
|
||||
totallen, MAX_BUFFER, g_libname, expanded);
|
||||
totallen, MAX_BUFFER, g_libname, quoted);
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
/* Append the next librarian command */
|
||||
|
||||
pathlen = snprintf(&g_command[cmdlen], MAX_BUFFER - cmdlen, "%s=-+%s",
|
||||
g_libname, expanded);
|
||||
g_libname, quoted);
|
||||
cmdlen += pathlen;
|
||||
|
||||
/* Terminate early if we have a LOT files in the command line */
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user