Josh Triplett
2021-Apr-17 19:35 UTC
[syslinux] [PATCH wip.makefixes 0/3] Build fixes for current syslinux
I was attempting to build the latest version of syslinux from git. The version at HEAD didn't build, so I tried the version on the wip.makefixes branch. In the course of trying to build that version, I ran into a few issues; these patches address some of those. With these patches, the build gets further, though it still fails with undefined references to `opendir`, `readdir`, and `closedir`, referenced from `com32/modules/dir.c`. /home/josh/src/syslinux/com32/modules/dir.c:80: undefined reference to `opendir' ld: /home/josh/src/syslinux/com32/modules/dir.c:86: undefined reference to `readdir' ld: /home/josh/src/syslinux/com32/modules/dir.c:110: undefined reference to `closedir' ld: /home/josh/src/syslinux/com32/modules/dir.c:148: undefined reference to `closedir' Josh Triplett (3): Mark e820_types as extern in header to avoid duplicate symbol Mark tcp_conn_ops as extern in header to avoid duplicate symbol Pass --wide to readelf to avoid truncating symbol names com32/gplinclude/memory.h | 2 +- core/export.pl | 2 +- core/include/core_pxe.h | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) -- 2.31.0
Josh Triplett
2021-Apr-17 19:35 UTC
[syslinux] [PATCH 1/3] Mark e820_types as extern in header to avoid duplicate symbol
Signed-off-by: Josh Triplett <josh at joshtriplett.org>
---
com32/gplinclude/memory.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/com32/gplinclude/memory.h b/com32/gplinclude/memory.h
index fe33c18d..1128d539 100644
--- a/com32/gplinclude/memory.h
+++ b/com32/gplinclude/memory.h
@@ -37,7 +37,7 @@ struct e820entry {
uint64_t type; /* type of memory segment */
} __attribute__ ((packed));
-const char *const e820_types[5];
+extern const char *const e820_types[5];
void get_type(int, char *, int);
void detect_memory_e820(struct e820entry *desc, int size_map, int *size_found);
--
2.31.0
Josh Triplett
2021-Apr-17 19:36 UTC
[syslinux] [PATCH 2/3] Mark tcp_conn_ops as extern in header to avoid duplicate symbol
Signed-off-by: Josh Triplett <josh at joshtriplett.org> --- core/include/core_pxe.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/include/core_pxe.h b/core/include/core_pxe.h index 19664f9b..54185e09 100644 --- a/core/include/core_pxe.h +++ b/core/include/core_pxe.h @@ -265,7 +265,7 @@ void ftp_open(struct url_info *url, int flags, struct inode *inode, int ftp_readdir(struct inode *inode, struct dirent *dirent); /* tcp.c */ -const struct pxe_conn_ops tcp_conn_ops; +extern const struct pxe_conn_ops tcp_conn_ops; extern void gpxe_init(void); extern int pxe_init(bool quiet); -- 2.31.0
Josh Triplett
2021-Apr-17 19:36 UTC
[syslinux] [PATCH 3/3] Pass --wide to readelf to avoid truncating symbol names
Current versions of readelf truncate symbol names to fit in 80
characters, even when not sending output to a terminal. Pass the --wide
option to prevent this.
Without this, the truncation marker would end up in the generated
libcore.S assembly file, resulting in lines like this:
.globl __syslinux_core_[...]
__syslinux_core_[...] = 0x00008862
.type __syslinux_core_[...], STT_OBJECT
.size __syslinux_core_[...], 2
And errors like this:
libcore.S: Assembler messages:
libcore.S:203: Error: junk at end of line, first unrecognized character is
`['
libcore.S:204: Error: invalid character '[' in mnemonic
libcore.S:205: Error: unrecognized symbol type ""
libcore.S:205: Error: junk at end of line, first unrecognized character is
`['
libcore.S:206: Error: expected comma after name `__syslinux_core_' in .size
directive
Signed-off-by: Josh Triplett <josh at joshtriplett.org>
---
core/export.pl | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/core/export.pl b/core/export.pl
index 16c63dbf..ad7d1528 100755
--- a/core/export.pl
+++ b/core/export.pl
@@ -22,7 +22,7 @@ my %fsyms; # Files in which this symbol occurs
my $readelf = $ENV{'READELF'} || 'readelf';
foreach my $infile (@infiles) {
- open(my $in, '-|', $readelf, '--dyn-syms', $infile)
+ open(my $in, '-|', $readelf, '--wide',
'--dyn-syms', $infile)
or die "$0: $infile: $!\n";
while (my $line = <$in>) {
--
2.31.0