delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2017/03/28/20:08:44

X-Recipient: archive-cygwin AT delorie DOT com
DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id
:list-unsubscribe:list-subscribe:list-archive:list-post
:list-help:sender:mime-version:from:date:message-id:subject:to
:content-type:content-transfer-encoding; q=dns; s=default; b=GRt
ieduXWveRQA9v+oY+zcpYFi1wM8YhALF8oJpy1B2jnP9ghGjjPvR0QUAaTtNBxBY
Lf8WzjtlyNhYBNfiwepQZBf/5WiD7xXO1OyvmdMFcUZjnqLf2kba1Jxu+9ihN6W0
raeHmkCitTwRfPw4oip3Z66P+GKD7drPOBt1b9LQ=
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id
:list-unsubscribe:list-subscribe:list-archive:list-post
:list-help:sender:mime-version:from:date:message-id:subject:to
:content-type:content-transfer-encoding; s=default; bh=SZAWuEHfs
7MMflmNfEY7pqgd7eA=; b=nuDnMnKfl186OZUj1QcZ6d9BlcH0tq2/EM8g3bQq5
UziCBKi9MlFYskGhfZPvhogxqOsWLOSsA7rPwVfHFs5AxsQE5Gt2UwWAA3HkupIp
Vyiy5BP/SJzCJU0zB4hDMNVDBo8xPXns5IikJ5qRCodWrSz3SV45zSEv8jN8COOq
RE=
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
Authentication-Results: sourceware.org; auth=none
X-Virus-Found: No
X-Spam-SWARE-Status: No, score=-1.4 required=5.0 tests=BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,RCVD_IN_SORBS_SPAM,SPF_PASS autolearn=no version=3.3.2 spammy=CYGWIN, denies, 182, guinea
X-HELO: mail-yw0-f173.google.com
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to :content-transfer-encoding; bh=GxTvc4pZE8J+Gh5RwjetvIxH+J+TwsgC3xQh4xu9F2w=; b=HpjRnjUSJyKbJusxQTvq/KKnPHrvofwEImSfbQE85q9EWyVb+Y25jE6FcFgOADOCLB OTfRqQUkN1jSjklKVtXIec2wvGm+bS/flAgLsDeeTdlEL8j7HQHTOlFnsnzEDOZRBsMV 6Y7AciKGnR0SIyZarm+eY5gZ0+emO9xLRaGkvHxTa7I5/fjqfhoUtbbx3RgJJstZOc8y STAWOqdCihWV7c4yHliB3Bulht6+ayQq1S3v81k2S/RAIJLdk3RMUOgcYCZ3M8cZEXD6 JV/F2EPxaiiGiRrKhRugUb8WOA3TfDF6ea+klmDyRYAQLh9mQzyTIl8DIxMdnVrNrOXo loIA==
X-Gm-Message-State: AFeK/H0fAJ1ELkGKVzFzrGqTwGaecqz58oxQQbijJArhcocfk6hvMS9fwI4K0MYh3LDPyLPEAtm2a10U1jkaEg==
X-Received: by 10.129.92.135 with SMTP id q129mr16712029ywb.57.1490746107083; Tue, 28 Mar 2017 17:08:27 -0700 (PDT)
MIME-Version: 1.0
From: "Edison M. Castro" <edisonmcastro AT gmail DOT com>
Date: Tue, 28 Mar 2017 20:08:26 -0400
Message-ID: <CAOGtp00F+pKRrfwnbLmugdzNj8P1nShBaEWs8KjG38BxZMcZXQ@mail.gmail.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
To: cygwin AT cygwin DOT com
X-MIME-Autoconverted: from quoted-printable to 8bit by delorie.com id v2T08hml017870

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


- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019