English Amiga Board


Go Back   English Amiga Board > Coders > Coders. Language > Coders. C/C++

 
 
Thread Tools
Old 18 September 2019, 15:58   #1161
bebbo
bye
 
Join Date: Jun 2016
Location: Some / Where
Posts: 681
Quote:
Originally Posted by _dante_ View Post
You are right, there is a difference in .stabs of argv.

GCC 6.4.1b:
Code:
    .stabs    "argv:p18=*19=*2",160,0,1,12
GCC 6.5.0b:
Code:
    .stabs    "argv:p18=*19=*2",160,0,1,4
Entire files attached.

it's fixed in gcc version 6.5.0b 190918153513


Thank's for reporting. (the preferred way to report is https://github.com/bebbo/gcc/issues)
bebbo is offline  
Old 18 September 2019, 21:07   #1162
_dante_
Registered User
 
Join Date: Feb 2018
Location: Poland
Posts: 12
Quote:
Originally Posted by bebbo View Post
it's fixed in gcc version 6.5.0b 190918153513


Thank's for reporting. (the preferred way to report is https://github.com/bebbo/gcc/issues)
I confirm it's fixed. Thanks!

If I find something to report in the future I will use github issue tracker for sure.
_dante_ is offline  
Old 20 September 2019, 11:19   #1163
Tigerskunk
Inviyya Dude!
 
Tigerskunk's Avatar
 
Join Date: Sep 2016
Location: Amiga Island
Posts: 2,793
Can someone tell me what kind of C++ version (e.g. "C++11" or "C++17") is supported by this compiler?
Tigerskunk is offline  
Old 20 September 2019, 12:45   #1164
bebbo
bye
 
Join Date: Jun 2016
Location: Some / Where
Posts: 681
Quote:
Originally Posted by Steril707 View Post
Can someone tell me what kind of C++ version (e.g. "C++11" or "C++17") is supported by this compiler?

both of above.

https://gcc.gnu.org/projects/cxx-status.html
bebbo is offline  
Old 20 September 2019, 12:46   #1165
Tigerskunk
Inviyya Dude!
 
Tigerskunk's Avatar
 
Join Date: Sep 2016
Location: Amiga Island
Posts: 2,793
Nice!
Thanks for the fast answer, Bebbo!
Tigerskunk is offline  
Old 24 September 2019, 22:12   #1166
Fook42
Registered User
 
Join Date: Aug 2016
Location: germany
Posts: 67
ld segfault

Hello..
i'm not sure this is a big issue, but i'm facing an ld-segfault from a trivial program.
gcc-version: gcc version 6.5.0b 190920220139 (GCC)

i have 2 files - _mystartup.c (is only a placeholder to get rid of unwanted main-function initializes)
Code:
int mymain(void);

int blabla(void)
{
    return mymain();
}
and here is the main.c
Code:
#define __NOLIBBASE__

int __nocommandline=1;
int __initlibraries=0;

int mymain(void)
{
    int             rc = 0;
    int             i;
    const char      text[] = "Hello World - This is a stupid text\0";
    volatile char   dest[200];
    int             text_len = sizeof(text);
    //--------------------------------------------------

    for ( i=0; i < text_len; ++i)
    {
        dest[i] = text[i];
        rc += dest[i];
    }
    return rc;
}
i compile this using this call :

$ m68k-amigaos-gcc -noixemul -nostartfiles -nostdlib -m68000 -o aout _mystartup.c main.c
collect2: fatal error: ld terminated with signal 11 [Segmentation fault], core dumped
compilation terminated.
/opt/amiga/lib/gcc/m68k-amigaos/6.5.0b/../../../../m68k-amigaos/bin/ld: /tmp/ccVjD6Dj.o: in function `mymain':


yes, i know this program does not make any sense, but where am i doing anything wrong to let the linker crash?
Fook42 is offline  
Old 26 September 2019, 11:28   #1167
bebbo
bye
 
Join Date: Jun 2016
Location: Some / Where
Posts: 681
Quote:
Originally Posted by Fook42 View Post
Hello..
i'm not sure this is a big issue, but i'm facing an ld-segfault from a trivial program.
gcc-version: gcc version 6.5.0b 190920220139 (GCC)

i have 2 files - _mystartup.c (is only a placeholder to get rid of unwanted main-function initializes)
Code:
int mymain(void);

int blabla(void)
{
    return mymain();
}
and here is the main.c
Code:
#define __NOLIBBASE__

int __nocommandline=1;
int __initlibraries=0;

int mymain(void)
{
    int             rc = 0;
    int             i;
    const char      text[] = "Hello World - This is a stupid text\0";
    volatile char   dest[200];
    int             text_len = sizeof(text);
    //--------------------------------------------------

    for ( i=0; i < text_len; ++i)
    {
        dest[i] = text[i];
        rc += dest[i];
    }
    return rc;
}
i compile this using this call :

$ m68k-amigaos-gcc -noixemul -nostartfiles -nostdlib -m68000 -o aout _mystartup.c main.c
collect2: fatal error: ld terminated with signal 11 [Segmentation fault], core dumped
compilation terminated.
/opt/amiga/lib/gcc/m68k-amigaos/6.5.0b/../../../../m68k-amigaos/bin/ld: /tmp/ccVjD6Dj.o: in function `mymain':


yes, i know this program does not make any sense, but where am i doing anything wrong to let the linker crash?
I get
Code:
/opt/amiga/lib/gcc/m68k-amigaos/6.5.0b/../../../../m68k-amigaos/bin/ld: /tmp/ccNIubOY.o: in function `mymain':
(.text+0x42): undefined reference to `memcpy'
collect2: error: ld returned 1 exit status
bebbo is offline  
Old 26 September 2019, 16:54   #1168
Hedeon
Semi-Retired
 
Join Date: Mar 2012
Location: Leiden / The Netherlands
Posts: 2,039
Quote:
Originally Posted by bebbo View Post
I get
Code:
/opt/amiga/lib/gcc/m68k-amigaos/6.5.0b/../../../../m68k-amigaos/bin/ld: /tmp/ccNIubOY.o: in function `mymain':
(.text+0x42): undefined reference to `memcpy'
collect2: error: ld returned 1 exit status
There are no external functions (let alone memcpy) in those two sources? How can it miss memcpy I wonder?
Hedeon is offline  
Old 26 September 2019, 17:05   #1169
Thomas Richter
Registered User
 
Join Date: Jan 2019
Location: Germany
Posts: 3,302
Quote:
Originally Posted by Hedeon View Post
There are no external functions (let alone memcpy) in those two sources? How can it miss memcpy I wonder?
Apparently, a call to memcpy is generated implicitly to initialize the text array. The source you have does do things: First, there is a string constant, and second a character array initialized from the string constant. In this specific case, it could optimize the copy away, but apparently, it does not.
Thomas Richter is offline  
Old 26 September 2019, 17:30   #1170
bebbo
bye
 
Join Date: Jun 2016
Location: Some / Where
Posts: 681
Quote:
Originally Posted by Thomas Richter View Post
Apparently, a call to memcpy is generated implicitly to initialize the text array. The source you have does do things: First, there is a string constant, and second a character array initialized from the string constant. In this specific case, it could optimize the copy away, but apparently, it does not.

that's a difference between



const char text[] ...


end


const char * text ...
bebbo is offline  
Old 28 September 2019, 20:46   #1171
Fook42
Registered User
 
Join Date: Aug 2016
Location: germany
Posts: 67
okay.. i understood, that the initialization of the string causes a memcpy-call.
but why do i see a linker segmentation fault ?

the linker works fine with different code-projects here.
Fook42 is offline  
Old 28 September 2019, 21:08   #1172
bebbo
bye
 
Join Date: Jun 2016
Location: Some / Where
Posts: 681
Quote:
Originally Posted by Fook42 View Post
okay.. i understood, that the initialization of the string causes a memcpy-call.
but why do i see a linker segmentation fault ?

the linker works fine with different code-projects here.

are you using cygwin/msys2?
bebbo is offline  
Old 28 September 2019, 21:28   #1173
Fook42
Registered User
 
Join Date: Aug 2016
Location: germany
Posts: 67
Quote:
Originally Posted by bebbo View Post
are you using cygwin/msys2?

i'm working with Linux.
5.0.0-29-generic #31-Ubuntu SMP Thu Sep 12 13:05:32 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux


all packages are uptodate:

Note, selecting 'libncurses-dev' instead of 'ncurses-dev'
autoconf is already the newest version (2.69-11).
bison is already the newest version (2:3.3.2.dfsg-1).
flex is already the newest version (2.6.4-6.2).
g++ is already the newest version (4:8.3.0-1ubuntu3).
gcc is already the newest version (4:8.3.0-1ubuntu3).
gettext is already the newest version (0.19.8.1-9).
git is already the newest version (1:2.20.1-2ubuntu1).
libgmp-dev is already the newest version (2:6.1.2+dfsg-4).
libmpc-dev is already the newest version (1.1.0-1).
libmpfr-dev is already the newest version (4.0.2-1).
libncurses-dev is already the newest version (6.1+20181013-2ubuntu2).
make is already the newest version (4.2.1-1.2).
wget is already the newest version (1.20.1-1ubuntu4).
lhasa is already the newest version (0.3.1-3).
texinfo is already the newest version (6.5.0.dfsg.1-4build1).
Fook42 is offline  
Old 29 September 2019, 14:21   #1174
bebbo
bye
 
Join Date: Jun 2016
Location: Some / Where
Posts: 681
Quote:
Originally Posted by Fook42 View Post
i'm working with Linux.
5.0.0-29-generic #31-Ubuntu SMP Thu Sep 12 13:05:32 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux

all packages are uptodate:
...

1. install valgrind
2. compile the *.c to *.o files:
Code:
m68k-amigaos-gcc -c *.c
3. run m68k-amigaos-gcc ... -v (using the *.o files)
Code:
m68k-amigaos-gcc -noixemul -nostartfiles -nostdlib -m68000 -o aout _mystartup.o main.o -v
4. pick the commandline with collect2 and invoke it
Code:
valgrind /opt/amiga/libexec/gcc/m68k-amigaos/6.5.0b/collect2 -L/opt/amiga/lib -L/opt/amiga/m68k-amigaos/libnix/lib -o aout -L/opt/amiga/m68k-amigaos/libnix/lib -L/opt/amiga/lib/gcc/m68k-amigaos/6.5.0b -L/opt/amiga/lib/gcc -L/opt/amiga/lib/gcc/m68k-amigaos/6.5.0b/../../../../m68k-amigaos/lib _mystartup.o main.o

it should print some info where the segfault occurs, if not: rebuild binutils with export CFLAGS="-g -O"

EDIT: and provide the info of collect2 -v
Code:
/opt/amiga/libexec/gcc/m68k-amigaos/6.5.0b/collect2 -v
collect2 version 6.5.0b 190923211820
/opt/amiga/bin/m68k-amigaos-ld -v
GNU ld (GNU Binutils) 2.32.51.190831-181535
bebbo is offline  
Old 29 September 2019, 16:15   #1175
Fook42
Registered User
 
Join Date: Aug 2016
Location: germany
Posts: 67
thanks bebbo for taking care of this...


collect2 -v gives:
Code:
collect2 version 6.5.0b 190920220139
/opt/amiga/bin/m68k-amigaos-ld -v
GNU ld (GNU Binutils) 2.32.51.190831-181535



output of
$ valgrind -v /opt/amiga/libexec/gcc/m68k-amigaos/6.5.0b/collect2 -L/opt/amiga/lib -L/opt/amiga/m68k-amigaos/libnix/lib -o aout -L/opt/amiga/m68k-amigaos/libnix/lib -L/opt/amiga/lib/gcc/m68k-amigaos/6.5.0b -L/opt/amiga/lib/gcc -L/opt/amiga/lib/gcc/m68k-amigaos/6.5.0b/../../../../m68k-amigaos/lib _mystartup.o main.o



Code:
==1995== Memcheck, a memory error detector
==1995== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al.
==1995== Using Valgrind-3.14.0-353a3587bb-20181007X and LibVEX; rerun with -h for copyright info
==1995== Command: /opt/amiga/libexec/gcc/m68k-amigaos/6.5.0b/collect2 -L/opt/amiga/lib -L/opt/amiga/m68k-amigaos/libnix/lib -o aout -L/opt/amiga/m68k-amigaos/libnix/lib -L/opt/amiga/lib/gcc/m68k-amigaos/6.5.0b -L/opt/amiga/lib/gcc -L/opt/amiga/lib/gcc/m68k-amigaos/6.5.0b/../../../../m68k-amigaos/lib _mystartup.o main.o
==1995== 
--1995-- Valgrind options:
--1995--    -v
--1995-- Contents of /proc/version:
--1995--   Linux version 5.0.0-29-generic (buildd@lcy01-amd64-030) (gcc version 8.3.0 (Ubuntu 8.3.0-6ubuntu1)) #31-Ubuntu SMP Thu Sep 12 13:05:32 UTC 2019
--1995-- 
--1995-- Arch and hwcaps: AMD64, LittleEndian, amd64-cx16-lzcnt-rdtscp-sse3-avx-avx2
--1995-- Page sizes: currently 4096, max supported 4096
--1995-- Valgrind library directory: /usr/lib/x86_64-linux-gnu/valgrind
--1995-- Reading syms from /opt/amiga/libexec/gcc/m68k-amigaos/6.5.0b/collect2
--1995-- Reading syms from /usr/lib/x86_64-linux-gnu/ld-2.29.so
--1995--   Considering /usr/lib/x86_64-linux-gnu/ld-2.29.so ..
--1995--   .. CRC mismatch (computed c34345a7 wanted 87a50cbd)
--1995--   Considering /lib/x86_64-linux-gnu/ld-2.29.so ..
--1995--   .. CRC mismatch (computed c34345a7 wanted 87a50cbd)
--1995--   Considering /usr/lib/debug/lib/x86_64-linux-gnu/ld-2.29.so ..
--1995--   .. CRC is valid
--1995-- Reading syms from /usr/lib/x86_64-linux-gnu/valgrind/memcheck-amd64-linux
--1995--    object doesn't have a symbol table
--1995--    object doesn't have a dynamic symbol table
--1995-- Scheduler: using generic scheduler lock implementation.
--1995-- Reading suppressions file: /usr/lib/x86_64-linux-gnu/valgrind/default.supp
==1995== embedded gdbserver: reading from /tmp/vgdb-pipe-from-vgdb-to-1995-by-renef-on-???
==1995== embedded gdbserver: writing to   /tmp/vgdb-pipe-to-vgdb-from-1995-by-renef-on-???
==1995== embedded gdbserver: shared mem   /tmp/vgdb-pipe-shared-mem-vgdb-1995-by-renef-on-???
==1995== 
==1995== TO CONTROL THIS PROCESS USING vgdb (which you probably
==1995== don't want to do, unless you know exactly what you're doing,
==1995== or are doing some strange experiment):
==1995==   /usr/lib/x86_64-linux-gnu/valgrind/../../bin/vgdb --pid=1995 ...command...
==1995== 
==1995== TO DEBUG THIS PROCESS USING GDB: start GDB like this
==1995==   /path/to/gdb /opt/amiga/libexec/gcc/m68k-amigaos/6.5.0b/collect2
==1995== and then give GDB the following command
==1995==   target remote | /usr/lib/x86_64-linux-gnu/valgrind/../../bin/vgdb --pid=1995
==1995== --pid is optional if only one valgrind process is running
==1995== 
--1995-- REDIR: 0x4020900 (ld-linux-x86-64.so.2:strlen) redirected to 0x580c7e62 (???)
--1995-- REDIR: 0x40206e0 (ld-linux-x86-64.so.2:index) redirected to 0x580c7e7c (???)
--1995-- Reading syms from /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_core-amd64-linux.so
--1995--    object doesn't have a symbol table
--1995-- Reading syms from /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so
--1995--    object doesn't have a symbol table
==1995== WARNING: new redirection conflicts with existing -- ignoring it
--1995--     old: 0x04020900 (strlen              ) R-> (0000.0) 0x580c7e62 ???
--1995--     new: 0x04020900 (strlen              ) R-> (2007.0) 0x0483bd50 strlen
--1995-- REDIR: 0x401d120 (ld-linux-x86-64.so.2:strcmp) redirected to 0x483ce10 (strcmp)
--1995-- REDIR: 0x4020e40 (ld-linux-x86-64.so.2:mempcpy) redirected to 0x4840830 (mempcpy)
--1995-- Reading syms from /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.26
--1995--    object doesn't have a symbol table
--1995-- Reading syms from /usr/lib/x86_64-linux-gnu/libgcc_s.so.1
--1995--    object doesn't have a symbol table
--1995-- Reading syms from /usr/lib/x86_64-linux-gnu/libc-2.29.so
--1995--   Considering /usr/lib/x86_64-linux-gnu/libc-2.29.so ..
--1995--   .. CRC mismatch (computed 6bda65da wanted 2c1cad96)
--1995--   Considering /lib/x86_64-linux-gnu/libc-2.29.so ..
--1995--   .. CRC mismatch (computed 6bda65da wanted 2c1cad96)
--1995--   Considering /usr/lib/debug/lib/x86_64-linux-gnu/libc-2.29.so ..
--1995--   .. CRC is valid
--1995-- Reading syms from /usr/lib/x86_64-linux-gnu/libm-2.29.so
--1995--   Considering /usr/lib/x86_64-linux-gnu/libm-2.29.so ..
--1995--   .. CRC mismatch (computed 20ae39ce wanted 54a9b04f)
--1995--   Considering /lib/x86_64-linux-gnu/libm-2.29.so ..
--1995--   .. CRC mismatch (computed 20ae39ce wanted 54a9b04f)
--1995--   Considering /usr/lib/debug/lib/x86_64-linux-gnu/libm-2.29.so ..
--1995--   .. CRC is valid
--1995-- REDIR: 0x4afe240 (libc.so.6:memmove) redirected to 0x482e1b0 (_vgnU_ifunc_wrapper)
--1995-- REDIR: 0x4afd3e0 (libc.so.6:strncpy) redirected to 0x482e1b0 (_vgnU_ifunc_wrapper)
--1995-- REDIR: 0x4afe560 (libc.so.6:strcasecmp) redirected to 0x482e1b0 (_vgnU_ifunc_wrapper)
--1995-- REDIR: 0x4afcd20 (libc.so.6:strcat) redirected to 0x482e1b0 (_vgnU_ifunc_wrapper)
--1995-- REDIR: 0x4afd440 (libc.so.6:rindex) redirected to 0x482e1b0 (_vgnU_ifunc_wrapper)
--1995-- REDIR: 0x4affd10 (libc.so.6:rawmemchr) redirected to 0x482e1b0 (_vgnU_ifunc_wrapper)
--1995-- REDIR: 0x4b1b330 (libc.so.6:wmemchr) redirected to 0x482e1b0 (_vgnU_ifunc_wrapper)
--1995-- REDIR: 0x4b1ad40 (libc.so.6:wcscmp) redirected to 0x482e1b0 (_vgnU_ifunc_wrapper)
--1995-- REDIR: 0x4afe3a0 (libc.so.6:mempcpy) redirected to 0x482e1b0 (_vgnU_ifunc_wrapper)
--1995-- REDIR: 0x4afe1d0 (libc.so.6:bcmp) redirected to 0x482e1b0 (_vgnU_ifunc_wrapper)
--1995-- REDIR: 0x4afd380 (libc.so.6:strncmp) redirected to 0x482e1b0 (_vgnU_ifunc_wrapper)
--1995-- REDIR: 0x4afcdd0 (libc.so.6:strcmp) redirected to 0x482e1b0 (_vgnU_ifunc_wrapper)
--1995-- REDIR: 0x4afe300 (libc.so.6:memset) redirected to 0x482e1b0 (_vgnU_ifunc_wrapper)
--1995-- REDIR: 0x4b1ad00 (libc.so.6:wcschr) redirected to 0x482e1b0 (_vgnU_ifunc_wrapper)
--1995-- REDIR: 0x4afd2e0 (libc.so.6:strnlen) redirected to 0x482e1b0 (_vgnU_ifunc_wrapper)
--1995-- REDIR: 0x4afcea0 (libc.so.6:strcspn) redirected to 0x482e1b0 (_vgnU_ifunc_wrapper)
--1995-- REDIR: 0x4afe5b0 (libc.so.6:strncasecmp) redirected to 0x482e1b0 (_vgnU_ifunc_wrapper)
--1995-- REDIR: 0x4afce40 (libc.so.6:strcpy) redirected to 0x482e1b0 (_vgnU_ifunc_wrapper)
--1995-- REDIR: 0x4afe6f0 (libc.so.6:memcpy@@GLIBC_2.14) redirected to 0x482e1b0 (_vgnU_ifunc_wrapper)
--1995-- REDIR: 0x4b1c650 (libc.so.6:wcsnlen) redirected to 0x482e1b0 (_vgnU_ifunc_wrapper)
--1995-- REDIR: 0x4afd480 (libc.so.6:strpbrk) redirected to 0x482e1b0 (_vgnU_ifunc_wrapper)
--1995-- REDIR: 0x4afcd80 (libc.so.6:index) redirected to 0x482e1b0 (_vgnU_ifunc_wrapper)
--1995-- REDIR: 0x4afd2a0 (libc.so.6:strlen) redirected to 0x482e1b0 (_vgnU_ifunc_wrapper)
--1995-- REDIR: 0x4b07240 (libc.so.6:memrchr) redirected to 0x482e1b0 (_vgnU_ifunc_wrapper)
--1995-- REDIR: 0x4afe600 (libc.so.6:strcasecmp_l) redirected to 0x482e1b0 (_vgnU_ifunc_wrapper)
--1995-- REDIR: 0x4afe190 (libc.so.6:memchr) redirected to 0x482e1b0 (_vgnU_ifunc_wrapper)
--1995-- REDIR: 0x4b1ae30 (libc.so.6:wcslen) redirected to 0x482e1b0 (_vgnU_ifunc_wrapper)
--1995-- REDIR: 0x4afd720 (libc.so.6:strspn) redirected to 0x482e1b0 (_vgnU_ifunc_wrapper)
--1995-- REDIR: 0x4afe500 (libc.so.6:stpncpy) redirected to 0x482e1b0 (_vgnU_ifunc_wrapper)
--1995-- REDIR: 0x4afe4a0 (libc.so.6:stpcpy) redirected to 0x482e1b0 (_vgnU_ifunc_wrapper)
--1995-- REDIR: 0x4affd50 (libc.so.6:strchrnul) redirected to 0x482e1b0 (_vgnU_ifunc_wrapper)
--1995-- REDIR: 0x4afe650 (libc.so.6:strncasecmp_l) redirected to 0x482e1b0 (_vgnU_ifunc_wrapper)
--1995-- REDIR: 0x4be5ec0 (libc.so.6:__strrchr_avx2) redirected to 0x483b760 (rindex)
--1995-- REDIR: 0x4af8a40 (libc.so.6:malloc) redirected to 0x48386e0 (malloc)
--1995-- REDIR: 0x4909a10 (libstdc++.so.6:operator new(unsigned long)) redirected to 0x4838d50 (operator new(unsigned long))
--1995-- REDIR: 0x4af9a00 (libc.so.6:calloc) redirected to 0x483aa80 (calloc)
--1995-- REDIR: 0x4be6090 (libc.so.6:__strlen_avx2) redirected to 0x483bc30 (strlen)
--1995-- REDIR: 0x4be1a10 (libc.so.6:__strncmp_avx2) redirected to 0x483c3e0 (strncmp)
--1995-- REDIR: 0x4be15d0 (libc.so.6:__strcmp_avx2) redirected to 0x483ccd0 (strcmp)
--1995-- REDIR: 0x4be7950 (libc.so.6:__strncpy_avx2) redirected to 0x483bf20 (strncpy)
--1995-- REDIR: 0x4af91d0 (libc.so.6:free) redirected to 0x4839910 (free)
--1995-- REDIR: 0x4be75c0 (libc.so.6:__strcpy_avx2) redirected to 0x483bd80 (strcpy)
--1995-- REDIR: 0x4be6540 (libc.so.6:__strcat_avx2) redirected to 0x483b910 (strcat)
--1995-- REDIR: 0x4be26a0 (libc.so.6:__memcmp_avx2_movbe) redirected to 0x483f030 (bcmp)
--1996-- REDIR: 0x4be5aa0 (libc.so.6:__strchr_avx2) redirected to 0x483b8e0 (index)
--1995-- REDIR: 0x4be82b0 (libc.so.6:__stpcpy_avx2) redirected to 0x483f150 (stpcpy)
--1995-- REDIR: 0x4be9060 (libc.so.6:__mempcpy_avx_unaligned_erms) redirected to 0x4840470 (mempcpy)
--1995-- REDIR: 0x4be5aa0 (libc.so.6:__strchr_avx2) redirected to 0x483b8e0 (index)
--1995-- REDIR: 0x4be5cd0 (libc.so.6:__strchrnul_avx2) redirected to 0x4840360 (strchrnul)
collect2: fatal error: ld terminated with signal 11 [Segmentation fault], core dumped
compilation terminated.
--1995-- REDIR: 0x4afdc70 (libc.so.6:__GI_strstr) redirected to 0x4840a90 (__strstr_sse2)
/opt/amiga/bin/m68k-amigaos-ld: main.o: in function `mymain':
--1995-- REDIR: 0x4907d70 (libstdc++.so.6:operator delete(void*, unsigned long)) redirected to 0x4839ff0 (operator delete(void*, unsigned long))
==1995== 
==1995== HEAP SUMMARY:
==1995==     in use at exit: 5,374 bytes in 45 blocks
==1995==   total heap usage: 83 allocs, 38 frees, 98,546 bytes allocated
==1995== 
==1995== Searching for pointers to 45 not-freed blocks
==1995== Checked 133,752 bytes
==1995== 
==1995== LEAK SUMMARY:
==1995==    definitely lost: 50 bytes in 3 blocks
==1995==    indirectly lost: 0 bytes in 0 blocks
==1995==      possibly lost: 0 bytes in 0 blocks
==1995==    still reachable: 5,324 bytes in 42 blocks
==1995==         suppressed: 0 bytes in 0 blocks
==1995== Rerun with --leak-check=full to see details of leaked memory
==1995== 
==1995== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)
==1995== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)
Fook42 is offline  
Old 29 September 2019, 16:30   #1176
bebbo
bye
 
Join Date: Jun 2016
Location: Some / Where
Posts: 681
Quote:
Originally Posted by Fook42 View Post
thanks bebbo for taking care of this...


collect2 -v gives:
Code:
collect2 version 6.5.0b 190920220139
/opt/amiga/bin/m68k-amigaos-ld -v
GNU ld (GNU Binutils) 2.32.51.190831-181535

...

now please replace collect2 with m68k-amigaos-ld (also adjust the path)

Code:
valgrind /opt/amiga/bin/m68k-amigaos-ld -L/opt/amiga/lib -L/opt/amiga/m68k-amigaos/libnix/lib -o aout -L/opt/amiga/m68k-amigaos/libnix/lib -L/opt/amiga/lib/gcc/m68k-amigaos/6.5.0b -L/opt/amiga/lib/gcc -L/opt/amiga/lib/gcc/m68k-amigaos/6.5.0b/../../../../m68k-amigaos/lib _mystartup.o main.o
bebbo is offline  
Old 29 September 2019, 16:35   #1177
Fook42
Registered User
 
Join Date: Aug 2016
Location: germany
Posts: 67
here is the output ... i have to state that there was a small pause at the end of the execution before the Segfault-message appeared.




$ valgrind /opt/amiga/bin/m68k-amigaos-ld -L/opt/amiga/lib -L/opt/amiga/m68k-amigaos/libnix/lib -o aout -L/opt/amiga/m68k-amigaos/libnix/lib -L/opt/amiga/lib/gcc/m68k-amigaos/6.5.0b -L/opt/amiga/lib/gcc -L/opt/amiga/lib/gcc/m68k-amigaos/6.5.0b/../../../../m68k-amigaos/lib _mystartup.o main.o


Code:
==2063== Memcheck, a memory error detector

==2063== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al.
==2063== Using Valgrind-3.14.0 and LibVEX; rerun with -h for copyright info
==2063== Command: /opt/amiga/bin/m68k-amigaos-ld -L/opt/amiga/lib -L/opt/amiga/m68k-amigaos/libnix/lib -o aout -L/opt/amiga/m68k-amigaos/libnix/lib -L/opt/amiga/lib/gcc/m68k-amigaos/6.5.0b -L/opt/amiga/lib/gcc -L/opt/amiga/lib/gcc/m68k-amigaos/6.5.0b/../../../../m68k-amigaos/lib _mystartup.o main.o
==2063== 
/opt/amiga/bin/m68k-amigaos-ld: main.o: in function `mymain':
==2063== Conditional jump or move depends on uninitialised value(s)
==2063==    at 0x13B3B3: vfinfo (in /opt/amiga/bin/m68k-amigaos-ld)
==2063==    by 0x13BA22: einfo (in /opt/amiga/bin/m68k-amigaos-ld)
==2063==    by 0x155543: get_relocated_section_contents (in /opt/amiga/bin/m68k-amigaos-ld)
==2063==    by 0x147485: default_indirect_link_order (in /opt/amiga/bin/m68k-amigaos-ld)
==2063==    by 0x155A39: amiga_final_link (in /opt/amiga/bin/m68k-amigaos-ld)
==2063==    by 0x1384F4: ldwrite (in /opt/amiga/bin/m68k-amigaos-ld)
==2063==    by 0x126D4F: main (in /opt/amiga/bin/m68k-amigaos-ld)
==2063== 
==2063== Use of uninitialised value of size 8
==2063==    at 0x170014: xstrdup (in /opt/amiga/bin/m68k-amigaos-ld)
==2063==    by 0x13B3B9: vfinfo (in /opt/amiga/bin/m68k-amigaos-ld)
==2063==    by 0x13BA22: einfo (in /opt/amiga/bin/m68k-amigaos-ld)
==2063==    by 0x155543: get_relocated_section_contents (in /opt/amiga/bin/m68k-amigaos-ld)
==2063==    by 0x147485: default_indirect_link_order (in /opt/amiga/bin/m68k-amigaos-ld)
==2063==    by 0x155A39: amiga_final_link (in /opt/amiga/bin/m68k-amigaos-ld)
==2063==    by 0x1384F4: ldwrite (in /opt/amiga/bin/m68k-amigaos-ld)
==2063==    by 0x126D4F: main (in /opt/amiga/bin/m68k-amigaos-ld)
==2063== 
==2063== Invalid read of size 1
==2063==    at 0x170014: xstrdup (in /opt/amiga/bin/m68k-amigaos-ld)
==2063==    by 0x13B3B9: vfinfo (in /opt/amiga/bin/m68k-amigaos-ld)
==2063==    by 0x13BA22: einfo (in /opt/amiga/bin/m68k-amigaos-ld)
==2063==    by 0x155543: get_relocated_section_contents (in /opt/amiga/bin/m68k-amigaos-ld)
==2063==    by 0x147485: default_indirect_link_order (in /opt/amiga/bin/m68k-amigaos-ld)
==2063==    by 0x155A39: amiga_final_link (in /opt/amiga/bin/m68k-amigaos-ld)
==2063==    by 0x1384F4: ldwrite (in /opt/amiga/bin/m68k-amigaos-ld)
==2063==    by 0x126D4F: main (in /opt/amiga/bin/m68k-amigaos-ld)
==2063==  Address 0x4 is not stack'd, malloc'd or (recently) free'd
==2063== 
==2063== 
==2063== Process terminating with default action of signal 11 (SIGSEGV)
==2063==  Access not within mapped region at address 0x4
==2063==    at 0x170014: xstrdup (in /opt/amiga/bin/m68k-amigaos-ld)
==2063==    by 0x13B3B9: vfinfo (in /opt/amiga/bin/m68k-amigaos-ld)
==2063==    by 0x13BA22: einfo (in /opt/amiga/bin/m68k-amigaos-ld)
==2063==    by 0x155543: get_relocated_section_contents (in /opt/amiga/bin/m68k-amigaos-ld)
==2063==    by 0x147485: default_indirect_link_order (in /opt/amiga/bin/m68k-amigaos-ld)
==2063==    by 0x155A39: amiga_final_link (in /opt/amiga/bin/m68k-amigaos-ld)
==2063==    by 0x1384F4: ldwrite (in /opt/amiga/bin/m68k-amigaos-ld)
==2063==    by 0x126D4F: main (in /opt/amiga/bin/m68k-amigaos-ld)
==2063==  If you believe this happened as a result of a stack
==2063==  overflow in your program's main thread (unlikely but
==2063==  possible), you can try to increase the size of the
==2063==  main thread stack using the --main-stacksize= flag.
==2063==  The main thread stack size used in this run was 8388608.
==2063== 
==2063== HEAP SUMMARY:
==2063==     in use at exit: 90,139 bytes in 108 blocks
==2063==   total heap usage: 146 allocs, 38 frees, 121,063 bytes allocated
==2063== 
==2063== LEAK SUMMARY:
==2063==    definitely lost: 11,461 bytes in 5 blocks
==2063==    indirectly lost: 0 bytes in 0 blocks
==2063==      possibly lost: 0 bytes in 0 blocks
==2063==    still reachable: 78,678 bytes in 103 blocks
==2063==         suppressed: 0 bytes in 0 blocks
==2063== Rerun with --leak-check=full to see details of leaked memory
==2063== 
==2063== For counts of detected and suppressed errors, rerun with: -v
==2063== Use --track-origins=yes to see where uninitialised values come from
==2063== ERROR SUMMARY: 3 errors from 3 contexts (suppressed: 0 from 0)
Segmentation fault (core dumped)
Fook42 is offline  
Old 29 September 2019, 17:39   #1178
bebbo
bye
 
Join Date: Jun 2016
Location: Some / Where
Posts: 681
Quote:
Originally Posted by Fook42 View Post
here is the output ... i have to state that there was a small pause at the end of the execution before the Segfault-message appeared.

$ valgrind /opt/amiga/bin/m68k-amigaos-ld -L/opt/amiga/lib -L/opt/amiga/m68k-amigaos/libnix/lib -o aout -L/opt/amiga/m68k-amigaos/libnix/lib -L/opt/amiga/lib/gcc/m68k-amigaos/6.5.0b -L/opt/amiga/lib/gcc -L/opt/amiga/lib/gcc/m68k-amigaos/6.5.0b/../../../../m68k-amigaos/lib _mystartup.o main.o


Code:
...

 ==2063== Conditional jump or move depends on uninitialised value(s)
==2063==    at 0x13B3B3: vfinfo (in /opt/amiga/bin/m68k-amigaos-ld)
==2063==    by 0x13BA22: einfo (in /opt/amiga/bin/m68k-amigaos-ld)
==2063==    by 0x155543: get_relocated_section_contents (in /opt/amiga/bin/m68k-amigaos-ld)
==2063==    by 0x147485: default_indirect_link_order (in /opt/amiga/bin/m68k-amigaos-ld)
==2063==    by 0x155A39: amiga_final_link (in /opt/amiga/bin/m68k-amigaos-ld)
==2063==    by 0x1384F4: ldwrite (in /opt/amiga/bin/m68k-amigaos-ld)
==2063==    by 0x126D4F: main (in /opt/amiga/bin/m68k-amigaos-ld)

Segmentation fault (core dumped)

I made a change and initialized some pointers
Should be live in ~ 1 hour from now
bebbo is offline  
Old 11 October 2019, 19:14   #1179
Toni Wilen
WinUAE developer
 
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 49
Posts: 26,553
Something seems to have changed since I last compiled pfs3aio (about a year ago), binary size is now about 5k larger. I also noticed that number of reloc entries has grown from about 207 to 979 which explains most of the size difference. Did the "trampoline" update stop working because I think originally pfs3aio did have about 1000 reloc entries?

Note that I didn't use exact same pfs3aio sources but changes are very minor. gcc updated and compiled few moments ago.
Toni Wilen is offline  
Old 11 October 2019, 20:27   #1180
bebbo
bye
 
Join Date: Jun 2016
Location: Some / Where
Posts: 681
Quote:
Originally Posted by Toni Wilen View Post
Something seems to have changed since I last compiled pfs3aio (about a year ago), binary size is now about 5k larger. I also noticed that number of reloc entries has grown from about 207 to 979 which explains most of the size difference. Did the "trampoline" update stop working because I think originally pfs3aio did have about 1000 reloc entries?

Note that I didn't use exact same pfs3aio sources but changes are very minor. gcc updated and compiled few moments ago.

hard to guess without more details - and yes there are changes in gcc too...


e.g. the support libs are now compiled with -O2 by default.


Code:
export CFLAGS_FOR_TARGET= -Os -fomit-frame-pointer
make clean-libnix
make libnix
gives you smaller noixemul libs. (maybe you have to rebuild a tad more...)


trampoline is still in place - maybe an option was not specified?


more details - more help. Feel free to file a bug.
bebbo is offline  
 


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Similar Threads
Thread Thread Starter Forum Replies Last Post
New GCC based dev toolchain for AmigaOS 3.x cla Coders. Releases 8 24 December 2017 10:18
Issue with photon/xxxx WinUAE Toolchain arpz Coders. Asm / Hardware 2 26 September 2015 22:33
New 68k gcc toolchain arti Coders. C/C++ 17 31 July 2015 03:59
Hannibal's WinUAE Demo Toolchain 5 Bobic Amiga scene 1 23 July 2015 21:04
From gcc to vbcc. Cowcat Coders. General 9 06 June 2014 14:45

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 11:03.

Top

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Page generated in 0.15181 seconds with 13 queries