NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: port-hppa/56876: hppa: "cc -pg" fails with "undefined reference to `mprotect'"



The following reply was made to PR port-hppa/56876; it has been noted by GNATS.

From: mlelstv%serpens.de@localhost (Michael van Elst)
To: gnats-bugs%netbsd.org@localhost
Cc: 
Subject: Re: port-hppa/56876: hppa: "cc -pg" fails with "undefined reference to `mprotect'"
Date: Sat, 11 Jun 2022 03:51:54 -0000 (UTC)

 tgl%sss.pgh.pa.us@localhost (Tom Lane) writes:
 
 >$ cc -pg -static hello.c
 >$ ./a.out
 >hello world
 >[ plausible-looking gmon.out produced, too ]
 
 
 It should be automatic with modern gcc. E.g. netbsd-9/i386:
 
 % cc -v
 Using built-in specs.
 COLLECT_GCC=cc
 COLLECT_LTO_WRAPPER=/usr/libexec/lto-wrapper
 Target: i486--netbsdelf
 Configured with: /usr/src/tools/gcc/../../external/gpl3/gcc/dist/configure --target=i486--netbsdelf --enable-long-long --enable-threads --with-bugurl=http://www.NetBSD.org/Misc/send-pr.html --with-pkgversion='NetBSD nb4 20200810' --with-system-zlib --without-isl --enable-__cxa_atexit --enable-libstdcxx-time=rt --enable-libstdcxx-threads --with-diagnostics-color=auto-if-env --with-arch=i486 --with-tune=nocona --with-default-libstdcxx-abi=new --with-mpc-lib=/var/obj/mknative/i386/usr/src/external/lgpl3/mpc/lib/libmpc --with-mpfr-lib=/var/obj/mknative/i386/usr/src/external/lgpl3/mpfr/lib/libmpfr --with-gmp-lib=/var/obj/mknative/i386/usr/src/external/lgpl3/gmp/lib/libgmp --with-mpc-include=/usr/src/external/lgpl3/mpc/dist/src --with-mpfr-include=/usr/src/external/lgpl3/mpfr/dist/src --with-gmp-include=/usr/src/external/lgpl3/gmp/lib/libgmp/arch/i386 --enable-tls --disable-multilib --disable-libstdcxx-pch --build=i486--netbsdelf --host=i486--netbsdelf --with-sysroot=/var/obj/mknative/i38
 6
  /usr/src/destdir.i386
 Thread model: posix
 gcc version 7.5.0 (nb4 20200810) 
 
 % cc c.c
 % file a.out
 a.out: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked, interpreter /usr/libexec/ld.elf_so, for NetBSD 9.2, not stripped
 
 % cc -pg c.c
 % file a.out
 a.out: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), statically linked, for NetBSD 9.2, with debug_info, not stripped
 
 


Home | Main Index | Thread Index | Old Index