From: "Edison M. Castro" <edisonmcastro@gmail.com>
To: cygwin@cygwin.com
Subject: Multiple Issues: Porting UserMOde Linux, Unable to compile binutils 2.28; current ld linker doesn't support weak NT exrternals well, access denies exception running executable etc
Date: Wed, 29 Mar 2017 07:30:00 -0000 [thread overview]
Message-ID: <CAOGtp00F+pKRrfwnbLmugdzNj8P1nShBaEWs8KjG38BxZMcZXQ@mail.gmail.com> (raw)
Guys
Sorry for bothering the list for my issues. I am trying to port User
Mode Linux. I am just at the beginning stages. I downloaded the latest
Linux version and started hacking it. After making several code
modifications, I am able to fully compile the source code. Now I am
only able to create the executable using MSYS2 ld. Using CUGWIN I get
several undefined references. All the reference symbols are WEAK
external symbols.
Now, in MSYS2 I am using binutils 2.26. This version has a WEAK NT
external patch (https://sourceware.org/ml/binutils/2015-10/msg00234.html).
My version in CYGWIN is 2.25.2. So, I tried to compile the latest
version of binutils 2.28. That fails to compile with the following
error
In file included from plural.y:35:0:
plural-exp.h:102:23: error: conflicting types for ‘libintl_gettextparse’
# define PLURAL_PARSE libintl_gettextparse
^
plural.y:40:25: note: in expansion of macro ‘PLURAL_PARSE’
# define __gettextparse PLURAL_PARSE
^~~~~~~~~~~~
plural.c:182:5: note: in expansion of macro ‘__gettextparse’
int __gettextparse (void);
^~~~~~~~~~~~~~
plural-exp.h:102:23: note: previous declaration of
‘libintl_gettextparse’ was here
# define PLURAL_PARSE libintl_gettextparse
^
plural-exp.h:114:12: note: in expansion of macro ‘PLURAL_PARSE’
extern int PLURAL_PARSE PARAMS ((void *arg));
^~~~~~~~~~~~
plural-exp.h:102:23: error: conflicting types for ‘libintl_gettextparse’
# define PLURAL_PARSE libintl_gettextparse
^
plural.y:40:25: note: in expansion of macro ‘PLURAL_PARSE’
# define __gettextparse PLURAL_PARSE
^~~~~~~~~~~~
plural.c:63:25: note: in expansion of macro ‘__gettextparse’
#define yyparse __gettextparse
^~~~~~~~~~~~~~
plural.c:1127:1: note: in expansion of macro ‘yyparse’
yyparse (void)
^~~~~~~
plural-exp.h:102:23: note: previous declaration of
‘libintl_gettextparse’ was here
# define PLURAL_PARSE libintl_gettextparse
^
plural-exp.h:114:12: note: in expansion of macro ‘PLURAL_PARSE’
extern int PLURAL_PARSE PARAMS ((void *arg));
^~~~~~~~~~~~
plural.c: In function ‘libintl_gettextparse’:
plural.c:64:25: error: too few arguments to function ‘__gettextlex’
#define yylex __gettextlex
^
plural.c:1296:16: note: in expansion of macro ‘yylex’
yychar = yylex (&yylval);
^~~~~
plural.c:64:25: note: declared here
#define yylex __gettextlex
^
plural.y:69:12: note: in expansion of macro ‘yylex’
static int yylex PARAMS ((YYSTYPE *lval, const char **pexp));
^~~~~
plural.y:178:29: error: ‘arg’ undeclared (first use in this function)
((struct parse_args *) arg)->res = $1;
^~~
plural.y:178:29: note: each undeclared identifier is reported only
once for each function it appears in
make[2]: *** [Makefile:133: plural.o] Error 1
make[2]: Leaving directory '/cygdrive/e/dev/GitHub/gnu/binutils-gdb/intl'
make[1]: *** [Makefile:6570: all-intl] Error 2
make[1]: Leaving directory '/cygdrive/e/dev/GitHub/gnu/binutils-gdb'
make: *** [Makefile:853: all] Error 2
Now, I go back an use the linker from MSYS2 and generate the
executable for Cygwin. When I run the executable, it runs very quickly
and returns. I debugging using gdb and I see a CFE somewhere inside
cygtls:call. I have tried many things to investigate why this is
happening, but I have been unable to get to the bottom of the problem.
I am thinking that this could be due to the use of LDS scripts to
generate the executable, but I really have no real clue that this
could be true. I also generated the executable by hand from the
vmlinux image using the command
gcc -Wl,--wrap,malloc -Wl,--wrap,free -Wl,--wrap,calloc -mcmodel=large
-Wl,--export-all-symbols -Wl,--enable-auto-import -o linux.exe vmlinux
-lws2_32
That still produce the same result. So, can someone help me diagnose
this problem better and address it, please?
I am your guinea pig.
Edison
--
Problem reports: http://cygwin.com/problems.html
FAQ: http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
reply other threads:[~2017-03-29 0:08 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CAOGtp00F+pKRrfwnbLmugdzNj8P1nShBaEWs8KjG38BxZMcZXQ@mail.gmail.com \
--to=edisonmcastro@gmail.com \
--cc=cygwin@cygwin.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).