Re: GDB TLS testing

Mark Millard via freebsd-ppc <[email protected]>
Newsgroups gmane.os.freebsd.devel.ppc
Message-ID <[email protected]>

On 2019-Jan-21, at 12:58, John Baldwin <jh at freebsd.org> wrote:

> . . .
> 
> Would someone with a working ppc system be willing to help test the GDB bits
> for me?  You can grab the 'fbsd_tls' branch from github/bsdjhb/gdb.git to
> build a GDB.  For testing purposes, just generating a core from the test
> programs I'm using and looking at that core on a non-ppc host would also
> work fine.  For example, in my case where I have the ppc system installed to
> /qemu/ppc64/rootfs, I would do 'set sysroot /qemu/ppc64/rootfs' at the GDB
> prompt to point GDB at the ppc64 libraries, etc.  Note that modern GDB is
> written in C++11, so you can't build it with gcc4.2.
> 
> The first test program I am using is below and should generate a core when
> run.  To test the TLS functionality you would want to make sure 'p id'
> reports the proper value (PID from the program's output), and also that
> 'p &id' also reports an address matching the program's output:
> 
> #include <stdio.h>
> #include <unistd.h>
> 
> static __thread int id;
> 
> int
> main(int ac, char **av)
> {
> 
> 	printf("main: PID %d\n", getpid());
> 	id = getpid();
> 	printf("id = %d (%p)\n", id, &id);
> 	(void)getchar();
> #if 1
> #if defined(__powerpc__)
> 	*(char *)NULL = 1;
> #else
> 	__builtin_trap();
> #endif
> #endif
> 	return (0);
> }

Note: This is from my odd devel/pwoerpc64-xtoolchain-gcc based buildworld
based environment with cc being system clang:

# uname -apKU
FreeBSD FBSDG5L 13.0-CURRENT FreeBSD 13.0-CURRENT #5 r341836M: Tue Dec 11 20:11:21 PST 2018     markmi@FBSDFSSD:/usr/obj/powerpc64vtsc_xtoolchain-gcc/powerpc.powerpc64/usr/src/powerpc.powerpc64/sys/GENERIC64vtsc-NODBG  powerpc powerpc64 1300005 1300005


Absent makeinfo the make failed to complete. (I've no clue if there are
more dependencies required.)

# ./configure
checking build system type... powerpc64-unknown-freebsd13.0
checking host system type... powerpc64-unknown-freebsd13.0
checking target system type... powerpc64-unknown-freebsd13.0
checking for a BSD-compatible install... /usr/bin/install -c
. . .
checking for makeinfo... no
/root/c_tests/ppc64_tls_git/missing: makeinfo: not found
checking for expect... no
. . .
# make
Configuring in ./libiberty
configure: creating cache ./config.cache
checking whether to enable maintainer-specific portions of Makefiles... no
checking for makeinfo... /root/c_tests/ppc64_tls_git/missing makeinfo --split-size=5000000
configure: WARNING:
*** Makeinfo is missing. Info documentation will not be built.
checking for perl... perl
. . .
creating bfdver.texi
restore=: && backupdir=".am$$" &&  rm -rf $backupdir && mkdir $backupdir &&  if (/root/c_tests/ppc64_tls_git/missing makeinfo --split-size=5000000 --split-size=5000000 --version) >/dev/null 2>&1; then  for f in bfd.info bfd.info-[0-9] bfd.info-[0-9][0-9] bfd.i[0-9] bfd.i[0-9][0-9]; do  if test -f $f; then mv $f $backupdir; restore=mv; else :; fi;  done;  else :; fi &&  if /root/c_tests/ppc64_tls_git/missing makeinfo --split-size=5000000 --split-size=5000000   -I .  -o bfd.info `test -f 'bfd.texi' || echo './'`bfd.texi;  then  rc=0;  else  rc=$?;  $restore $backupdir/* `echo "./bfd.info" | sed 's|[^/]*$||'`;  fi;  rm -rf $backupdir; exit $rc
/root/c_tests/ppc64_tls_git/missing: makeinfo: not found
WARNING: 'makeinfo' is missing on your system.
         You should only need it if you modified a '.texi' file, or
         any other file indirectly affecting the aspect of the manual.
         You might want to install the Texinfo package:
         <http://www.gnu.org/software/texinfo/>
         The spurious makeinfo call might also be the consequence of
         using a buggy 'make' (AIX, DU, IRIX), in which case you might
         want to install GNU make:
         <http://www.gnu.org/software/make/>
*** Error code 127

Stop.
make[3]: stopped in /root/c_tests/ppc64_tls_git/bfd/doc
*** Error code 1

Stop.
make[2]: stopped in /root/c_tests/ppc64_tls_git/bfd
*** Error code 1

Stop.
make[1]: stopped in /root/c_tests/ppc64_tls_git
*** Error code 1

Stop.
make: stopped in /root/c_tests/ppc64_tls_git


===
Mark Millard
marklmi at yahoo.com
( dsl-only.net went
away in early 2018-Mar)

_______________________________________________
[email protected] mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-ppc
To unsubscribe, send any mail to "[email protected]"
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.