all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Alex Vong <alexvong1995@gmail.com>
To: "Ludovic Courtès" <ludo@gnu.org>
Cc: guix-devel@gnu.org
Subject: Re: [PATCH 1/2] daemon: Fix '--version'.
Date: Thu, 01 Sep 2016 14:23:51 +0800	[thread overview]
Message-ID: <87pooo3zpk.fsf@gmail.com> (raw)
In-Reply-To: <877fawk5fv.fsf@gnu.org> ("Ludovic \=\?utf-8\?Q\?Court\=C3\=A8s\=22'\?\= \=\?utf-8\?Q\?s\?\= message of "Wed, 31 Aug 2016 23:13:24 +0200")

Hi Ludovic,

ludo@gnu.org (Ludovic Courtès) writes:

> Hi Alex,
>
> Alex Vong <alexvong1995@gmail.com> skribis:
>
[...]
>
>> I get this output instead:
>>
>> $ LC_ALL=C ./guix-daemon --version
>> ./guix-daemon: unrecognized option '--version'
>> Try `guix-daemon --help' or `guix-daemon --usage' for more information.
>>
>> This is werid, but I think it is because I build guix with lto.
>
> What about the attached program?  It works for me with GCC 6.2.0, both
> with and without LTO.
>
> Ludo’.
>
> #include <argp.h>
>
> const char *argp_program_version = "foo";
> const char *argp_program_bug_address = "foo@example.org";
>
> static const struct argp_option options[] =
>   {
>     { "system", 's', "SYSTEM", 0,
>       "assume SYSTEM as the current system type" },
>     { 0, 0, 0, 0, 0 }
>   };
>
> static const struct argp argp =
>   {
>     options, NULL,
>     NULL, "doc",
>     NULL, NULL,
>     NULL
>   };
>
> int
> main (int argc, char *argv[])
> {
>   argp_parse (&argp, argc, argv, 0, 0, 0);
>   return 0;
> }

I think you have isolated the problem! This test case does not work for
me.


I get the following output after building with
(g++ -O2 -flto version.cxx):
==============================================================================
alexvong1995@debian:~/c++$ ./a.out --version
./a.out: unrecognized option '--version'
Try `a.out --help' or `a.out --usage' for more information.
===========================================================================
alexvong1995@debian:~/c++$ ./a.out --help
Usage: a.out [OPTION...]
doc

  -s, --system=SYSTEM        assume SYSTEM as the current system type
  -?, --help                 Give this help list
      --usage                Give a short usage message

Mandatory or optional arguments to long options are also mandatory or optional
for any corresponding short options.
===========================================================================


My gcc version is also 6.2.0:
===========================================================================
alexvong1995@debian:~/c++$ LC_ALL=C g++ --version
g++ (GCC) 6.2.0
Copyright (C) 2016 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

===========================================================================


Running strace show the following output
(ltrace output is not intersting):
===========================================================================
alexvong1995@debian:~/c++$ strace ./a.out --version
execve("./a.out", ["./a.out", "--version"], [/* 71 vars */]) = 0
brk(0)                                  = 0xf63000
mmap(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7fc8f6b26000
access("/etc/ld.so.preload", R_OK)      = -1 ENOENT (No such file or directory)
open("/gnu/store/m9vxvhdj691bq1f85lpflvnhcvrdilih-glibc-2.23/lib/tls/x86_64/libstdc++.so.6", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
stat("/gnu/store/m9vxvhdj691bq1f85lpflvnhcvrdilih-glibc-2.23/lib/tls/x86_64", 0x7fff93fa35f0) = -1 ENOENT (No such file or directory)
open("/gnu/store/m9vxvhdj691bq1f85lpflvnhcvrdilih-glibc-2.23/lib/tls/libstdc++.so.6", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
stat("/gnu/store/m9vxvhdj691bq1f85lpflvnhcvrdilih-glibc-2.23/lib/tls", 0x7fff93fa35f0) = -1 ENOENT (No such file or directory)
open("/gnu/store/m9vxvhdj691bq1f85lpflvnhcvrdilih-glibc-2.23/lib/x86_64/libstdc++.so.6", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
stat("/gnu/store/m9vxvhdj691bq1f85lpflvnhcvrdilih-glibc-2.23/lib/x86_64", 0x7fff93fa35f0) = -1 ENOENT (No such file or directory)
open("/gnu/store/m9vxvhdj691bq1f85lpflvnhcvrdilih-glibc-2.23/lib/libstdc++.so.6", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
stat("/gnu/store/m9vxvhdj691bq1f85lpflvnhcvrdilih-glibc-2.23/lib", {st_mode=S_IFDIR|0555, st_size=4096, ...}) = 0
open("/gnu/store/v9r00bv3ivimpr0nzhaas3rsqaa5xvbw-gcc-6.2.0-lib/lib/tls/x86_64/libstdc++.so.6", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
stat("/gnu/store/v9r00bv3ivimpr0nzhaas3rsqaa5xvbw-gcc-6.2.0-lib/lib/tls/x86_64", 0x7fff93fa35f0) = -1 ENOENT (No such file or directory)
open("/gnu/store/v9r00bv3ivimpr0nzhaas3rsqaa5xvbw-gcc-6.2.0-lib/lib/tls/libstdc++.so.6", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
stat("/gnu/store/v9r00bv3ivimpr0nzhaas3rsqaa5xvbw-gcc-6.2.0-lib/lib/tls", 0x7fff93fa35f0) = -1 ENOENT (No such file or directory)
open("/gnu/store/v9r00bv3ivimpr0nzhaas3rsqaa5xvbw-gcc-6.2.0-lib/lib/x86_64/libstdc++.so.6", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
stat("/gnu/store/v9r00bv3ivimpr0nzhaas3rsqaa5xvbw-gcc-6.2.0-lib/lib/x86_64", 0x7fff93fa35f0) = -1 ENOENT (No such file or directory)
open("/gnu/store/v9r00bv3ivimpr0nzhaas3rsqaa5xvbw-gcc-6.2.0-lib/lib/libstdc++.so.6", O_RDONLY|O_CLOEXEC) = 3
read(3, "\177ELF\2\1\1\3\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\20\255\10\0\0\0\0\0"..., 832) = 832
fstat(3, {st_mode=S_IFREG|0555, st_size=2032024, ...}) = 0
mmap(NULL, 3666688, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7fc8f6586000
mprotect(0x7fc8f66f7000, 2093056, PROT_NONE) = 0
mmap(0x7fc8f68f6000, 49152, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x170000) = 0x7fc8f68f6000
mmap(0x7fc8f6902000, 13056, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7fc8f6902000
close(3)                                = 0
open("/gnu/store/m9vxvhdj691bq1f85lpflvnhcvrdilih-glibc-2.23/lib/libm.so.6", O_RDONLY|O_CLOEXEC) = 3
read(3, "\177ELF\2\1\1\3\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0`U\0\0\0\0\0\0"..., 832) = 832
fstat(3, {st_mode=S_IFREG|0555, st_size=1141048, ...}) = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7fc8f6b25000
mmap(NULL, 3166528, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7fc8f6280000
mprotect(0x7fc8f6385000, 2093056, PROT_NONE) = 0
mmap(0x7fc8f6584000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x104000) = 0x7fc8f6584000
close(3)                                = 0
open("/gnu/store/m9vxvhdj691bq1f85lpflvnhcvrdilih-glibc-2.23/lib/libgcc_s.so.1", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
open("/gnu/store/v9r00bv3ivimpr0nzhaas3rsqaa5xvbw-gcc-6.2.0-lib/lib/libgcc_s.so.1", O_RDONLY|O_CLOEXEC) = 3
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0p*\0\0\0\0\0\0"..., 832) = 832
fstat(3, {st_mode=S_IFREG|0444, st_size=100680, ...}) = 0
mmap(NULL, 2185584, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7fc8f606a000
mprotect(0x7fc8f6080000, 2093056, PROT_NONE) = 0
mmap(0x7fc8f627f000, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x15000) = 0x7fc8f627f000
close(3)                                = 0
open("/gnu/store/m9vxvhdj691bq1f85lpflvnhcvrdilih-glibc-2.23/lib/libc.so.6", O_RDONLY|O_CLOEXEC) = 3
read(3, "\177ELF\2\1\1\3\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0 \t\2\0\0\0\0\0"..., 832) = 832
fstat(3, {st_mode=S_IFREG|0555, st_size=1942128, ...}) = 0
mmap(NULL, 3808896, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7fc8f5cc8000
mprotect(0x7fc8f5e61000, 2093056, PROT_NONE) = 0
mmap(0x7fc8f6060000, 24576, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x198000) = 0x7fc8f6060000
mmap(0x7fc8f6066000, 16000, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7fc8f6066000
close(3)                                = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7fc8f6b24000
mmap(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7fc8f6b22000
arch_prctl(ARCH_SET_FS, 0x7fc8f6b22740) = 0
mprotect(0x7fc8f6060000, 16384, PROT_READ) = 0
mprotect(0x7fc8f6584000, 4096, PROT_READ) = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7fc8f6b21000
mprotect(0x7fc8f68f6000, 40960, PROT_READ) = 0
mprotect(0x7fc8f6b28000, 4096, PROT_READ) = 0
brk(0)                                  = 0xf63000
brk(0xf95000)                           = 0xf95000
write(2, "./a.out: unrecognized option '--"..., 41./a.out: unrecognized option '--version'
) = 41
write(2, "Try `a.out --help' or `a.out --u"..., 60Try `a.out --help' or `a.out --usage' for more information.
) = 60
exit_group(64)                          = ?
+++ exited with 64 +++
===========================================================================


Do you have any idea?


Thanks,
Alex

  reply	other threads:[~2016-09-01  6:24 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-24  1:34 [PATCH 1/2] daemon: Fix '--version' Alex Vong
2016-08-29  1:31 ` (ping!) " Alex Vong
2016-08-29 16:12 ` Ludovic Courtès
2016-08-30  4:29   ` Alex Vong
2016-08-31 21:13     ` Ludovic Courtès
2016-09-01  6:23       ` Alex Vong [this message]
2016-09-01 12:15         ` Ludovic Courtès
2016-09-02  1:00           ` Alex Vong
2016-09-02 12:41             ` Ludovic Courtès

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=87pooo3zpk.fsf@gmail.com \
    --to=alexvong1995@gmail.com \
    --cc=guix-devel@gnu.org \
    --cc=ludo@gnu.org \
    /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.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.