From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10166 invoked by alias); 31 May 2013 16:50:33 -0000 Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org Received: (qmail 10145 invoked by uid 89); 31 May 2013 16:50:29 -0000 X-Spam-SWARE-Status: No, score=-3.0 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,KHOP_THREADED,RCVD_IN_DNSWL_LOW,RCVD_IN_HOSTKARMA_YE,SPF_PASS,TW_QE autolearn=ham version=3.3.1 Received: from mail-vb0-f42.google.com (HELO mail-vb0-f42.google.com) (209.85.212.42) by sourceware.org (qpsmtpd/0.84/v0.84-167-ge50287c) with ESMTP; Fri, 31 May 2013 16:50:28 +0000 Received: by mail-vb0-f42.google.com with SMTP id w15so1223535vbf.29 for ; Fri, 31 May 2013 09:50:26 -0700 (PDT) MIME-Version: 1.0 X-Received: by 10.220.105.9 with SMTP id r9mr10953041vco.60.1370019026839; Fri, 31 May 2013 09:50:26 -0700 (PDT) Received: by 10.58.218.106 with HTTP; Fri, 31 May 2013 09:50:26 -0700 (PDT) In-Reply-To: References: Date: Fri, 31 May 2013 16:50:00 -0000 Message-ID: Subject: Re: Simulator question about argc/argv From: Andrew Pinski To: Steve Ellcey Cc: gdb@gcc.gnu.org Content-Type: text/plain; charset=UTF-8 X-SW-Source: 2013-05/txt/msg00145.txt.bz2 On Fri, May 31, 2013 at 9:47 AM, Steve Ellcey wrote: > > Some new tests have been added to the GCC testsuite (cilk tests) that > check the value of argc and they expect it to be 1 if there are no > arguments to the test program (and there are none) but I am getting 0 > when I run the tests under the gnu simulator. Does anyone know why > this is? I don't know if this is specific to my target (mips-mti-elf) > or a general simulator problem. Perhaps it is related to my linker > script? The mips-mti-elf target is built with newlib. Could someone > else who uses the gnu simulator and newlib try this. It works fine for > me under the qemu simulator. > > % cat x.c > #include > int main(int argc, char **argv) > { > printf("%d\n", argc); > return 0; > } > > % mips-mti-elf-gcc x.c -Tmti32.ld -o x > % mips-mti-elf-run ./x > 0 > % mips-mti-elf-run ./x 99 > 0 I get a similar thing on both of Cavium's internal simulators (MIPS64 and AARCH64) when running with bare metal. I normally just go and fix the testcase not to depend on argc. Thanks, Andrew > > Steve Ellcey > sellcey@mips.com >