Qemu-system-mips stuck after "console [tty0] enabled" - virtual-machine

I tried to use jcowgill's pre-compiled kernel and QCOW2 Disk Image, but qemu got stuck here after some output. Don't know what happened, qemu is just stuck here and I can't enter any commands.
Command:
qemu-system-mips64el \
-M malta \
-cpu MIPS64R2-generic \
-m 2G \
-append 'root=/dev/sda2 console=tty0 mem=2048m nokaslr' \
-nographic \
-kernel vmlinux-4.9.0-4-5kc-malta.mipsel.stretch \
-initrd initrd.img-4.9.0-4-5kc-malta.mipsel.stretch \
-drive file=debian-stretch-mipsel.qcow2
Output:
[ 0.000000] Linux version 4.9.0-4-5kc-malta (debian-kernel#lists.debian.org) (gcc version 6.3.0 20170516 (Debian 6.3.0-18) ) #1 Debian 4.9.65-3 (2017-12-03)
[ 0.000000] earlycon: uart8250 at I/O port 0x3f8 (options '38400n8')
[ 0.000000] bootconsole [uart8250] enabled
[ 0.000000] CPU0 revision is: 00010000 (MIPS GENERIC QEMU)
[ 0.000000] FPU revision is: 007f0000
[ 0.000000] Checking for the multiply/shift bug... [ 0.000000] no.
[ 0.000000] Checking for the daddiu bug... [ 0.000000] no.
[ 0.000000] MIPS: machine is mti,malta
[ 0.000000] Software DMA cache coherency enabled
[ 0.000000] Determined physical RAM map:
[ 0.000000] memory: 0000000010000000 # 0000000000000000 (usable)
[ 0.000000] memory: 0000000070000000 # 0000000090000000 (usable)
[ 0.000000] User-defined physical RAM map:
[ 0.000000] memory: 0000000080000000 # 0000000000000000 (usable)
[ 0.000000] Initial ramdisk at: 0x900000000ed70000 (19204358 bytes)
[ 0.000000] Reserving 0MB of memory at 0MB for crashkernel
[ 0.000000] Primary instruction cache 32kB, VIPT, 4-way, linesize 32 bytes.
[ 0.000000] Primary data cache 32kB, 4-way, VIPT, cache aliases, linesize 32 bytes
[ 0.000000] Zone ranges:
[ 0.000000] DMA [mem 0x0000000000000000-0x0000000000ffffff]
[ 0.000000] DMA32 [mem 0x0000000001000000-0x00000000ffffffff]
[ 0.000000] Normal empty
[ 0.000000] Movable zone start for each node
[ 0.000000] Early memory node ranges
[ 0.000000] node 0: [mem 0x0000000000000000-0x000000007fffffff]
[ 0.000000] Initmem setup node 0 [mem 0x0000000000000000-0x000000007fffffff]
[ 0.000000] Built 1 zonelists in Zone order, mobility grouping on. Total pages: 516096
[ 0.000000] Kernel command line: rd_start=0xffffffff8ed70000 rd_size=19204358 root=/dev/sda2 console=tty0 mem=2048m nokaslr
[ 0.000000] PID hash table entries: 4096 (order: 3, 32768 bytes)
[ 0.000000] Dentry cache hash table entries: 262144 (order: 9, 2097152 bytes)
[ 0.000000] Inode-cache hash table entries: 131072 (order: 8, 1048576 bytes)
[ 0.000000] Writing ErrCtl register=00000000
[ 0.000000] Readback ErrCtl register=00000000
[ 0.000000] Memory: 2030840K/2097152K available (6118K kernel code, 982K rwdata, 1596K rodata, 1516K init, 360K bss, 66312K reserved, 0K cma-reserved)
[ 0.000000] NR_IRQS:256
[ 0.000000] CPU frequency 200.00 MHz
[ 0.000000] clocksource: MIPS: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112681107 ns
[ 0.000108] sched_clock: 32 bits at 99MHz, resolution 10ns, wraps every 21474922490ns
[ 0.004826] Console: colour dummy device 80x25
[ 0.005174] console [tty0] enabled
[ 0.005521] bootconsole [uart8250] disabled
The kernel and img files are downloaded from https://people.debian.org/~jcowgill/qemu-mips/
vmlinux-4.9.0-4-5kc-malta.mipsel.stretch
initrd.img-4.9.0-4-5kc-malta.mipsel.stretch
debian-stretch-mipsel.qcow2

Your kernel command line says "console=tty0", which means "please send console to the first virtual terminal", ie to the graphics device. But there is no graphics device in the machine you're running (you say "-nographic" on your QEMU command line and the kernel says "Console: colour dummy device 80x25"). So what happens is that you see the initial bootup messages via the "uart8250" earlycon (ie the serial port), but as soon as the kernel gets to a point where it can honour your command line request, it enables tty0 (which goes nowhere) and disables uart8250 (so you see no further output).
You need to tell the kernel to send the console output to the serial port if that's where you'd like to see it appear, which for the malta board I think you can do by using "console=ttyS0" instead. Alternatively, you can drop '-nographic', make sure your kernel has the driver for the VGA card built in, and leave "console=tty0" and you'll see the console on the virtual console on the graphical window.
If you look at the README for the website you downloaded your image files from you'll see that it does indeed suggest using "console=ttyS0".

Related

How can I low ksoftirq usage when it hits 100% of a CPU?

I have a Linux server with 48 CPU and, from time to time, some of them starts hitting almost 100% of usage. And when that happens, the usage doesn't go down and that's affecting some services performance.
When I reboot this server, everything goes ok for several days when some starts hitting almost 100% of usage again. This is like a cycle.
The problem is that the usage of some CUP, when hits 100%, doesn't change, unless I reboot server, and there is a service that's performing badly when that occurs.
When I use the htop command, I can see some process ksoftirq/0, ksoftirq/1, ksoftirq/2 ... is the responsible for this usage. I don't know what to do.
One approach that I tried was: I observed that the number of CPU where that occurs tends to be in the first half (0-23). I tried to change the affinity of those process (ksoftirq) to another CPU in the second half (24-47), but without any success.
What I want is: how to low this ksoftirq process usage or, at least, how to distribute them in order to keep CPU with a usage lower?
I'm not sure if the solution is about changing the affinity or changing some other attribute. I'm really clueless in this situation.
This is a physical server. Some info about it:
output of lsb_release -a:
No LSB modules are available.
Distributor ID: Debian
Description: Debian GNU/Linux 11 (bullseye)
Release: 11
Codename: bullseye
output of uname -a:
Linux tiamat-dc 5.10.0-10-amd64 #1 SMP Debian 5.10.84-1 (2021-12-08) x86_64 GNU/Linux
output of lscpu:
Architecture: x86_64
CPU op-mode(s): 32-bit, 64-bit
Byte Order: Little Endian
Address sizes: 44 bits physical, 48 bits virtual
CPU(s): 48
On-line CPU(s) list: 0-47
Thread(s) per core: 2
Core(s) per socket: 6
Socket(s): 4
NUMA node(s): 4
Vendor ID: GenuineIntel
CPU family: 6
Model: 46
Model name: Intel(R) Xeon(R) CPU E7530 # 1.87GHz
Stepping: 6
CPU MHz: 1239.565
BogoMIPS: 3723.93
Virtualization: VT-x
L1d cache: 768 KiB
L1i cache: 768 KiB
L2 cache: 6 MiB
L3 cache: 48 MiB
NUMA node0 CPU(s): 0,4,8,12,16,20,24,28,32,36,40,44
NUMA node1 CPU(s): 1,5,9,13,17,21,25,29,33,37,41,45
NUMA node2 CPU(s): 2,6,10,14,18,22,26,30,34,38,42,46
NUMA node3 CPU(s): 3,7,11,15,19,23,27,31,35,39,43,47
Vulnerability Itlb multihit: KVM: Mitigation: VMX disabled
Vulnerability L1tf: Mitigation; PTE Inversion; VMX conditional cache flushes, SMT vulnerable
Vulnerability Mds: Vulnerable: Clear CPU buffers attempted, no microcode; SMT vulnerable
Vulnerability Meltdown: Mitigation; PTI
Vulnerability Spec store bypass: Mitigation; Speculative Store Bypass disabled via prctl and seccomp
Vulnerability Spectre v1: Mitigation; usercopy/swapgs barriers and __user pointer sanitization
Vulnerability Spectre v2: Mitigation; Full generic retpoline, IBPB conditional, IBRS_FW, STIBP conditional, RSB filling
Vulnerability Srbds: Not affected
Vulnerability Tsx async abort: Not affected
Flags: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ht tm pbe syscall nx rdtscp l
m constant_tsc arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc cpuid aperfmperf pni dtes64 monitor ds_cpl vmx est tm2 ssse3 cx
16 xtpr pdcm dca sse4_1 sse4_2 x2apic popcnt lahf_lm pti ssbd ibrs ibpb stibp tpr_shadow vnmi flexpriority ept vpid dtherm ida flush_l1d

Does Apache Guacamole support VNC Connection with GNUTLS?

Currently I've working on my custom Remote Desktop Service which is strongly based on Apache Guacamole.
I found that I can encrypt VNC connection between Guacamole (which is actually LibVNCClient) and my TigerVNC Server with SSL/TLS.
So I built LibVNCServer with -DWITH_GNUTLS=ON -DWITH_OPENSSL=OFFoption and installed Guacamole based on customed LibVNCServer.
Below is the generated log when I build LibVNCServer and Guacamole.
cmake -DWITH_OPENSSL=OFF -DWITH_GNUTLS=ON ..
-- The C compiler identification is GNU 4.8.5
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Found ZLIB: /usr/lib64/libz.so (found version "1.2.7")
-- Found LZO: /usr/lib64/liblzo2.so
-- Found JPEG: /usr/lib64/libjpeg.so (found version "62")
-- Performing Test FOUND_LIBJPEG_TURBO
-- Performing Test FOUND_LIBJPEG_TURBO - Success
-- Found PNG: /usr/lib64/libpng.so (found version "1.5.13")
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE
-- Found SDL2: /usr/lib64/libSDL2.so;-lpthread
-- Found GTK2_GTK: /usr/lib64/libgtk-x11-2.0.so
-- Found GnuTLS: /usr/lib64/libgnutls.so (found version "3.3.29")
-- Found PkgConfig: /usr/bin/pkg-config (found version "0.27.1")
-- Checking for module 'libsystemd'
-- Found libsystemd, version 219
-- Found FFMPEG: /usr/include/ffmpeg (found suitable version "3.4.9", minimum required is "3.1.0") found components: avformat avcodec avutil swscale
-- Looking for dirent.h
-- Looking for dirent.h - found
-- Looking for endian.h
-- Looking for endian.h - found
-- Looking for fcntl.h
-- Looking for fcntl.h - found
-- Looking for netinet/in.h
-- Looking for netinet/in.h - found
-- Looking for sys/endian.h
-- Looking for sys/endian.h - not found
-- Looking for sys/socket.h
-- Looking for sys/socket.h - found
-- Looking for sys/stat.h
-- Looking for sys/stat.h - found
-- Looking for sys/time.h
-- Looking for sys/time.h - found
-- Looking for sys/types.h
-- Looking for sys/types.h - found
-- Looking for sys/wait.h
-- Looking for sys/wait.h - found
-- Looking for unistd.h
-- Looking for unistd.h - found
-- Looking for sys/resource.h
-- Looking for sys/resource.h - found
-- Looking for vfork.h
-- Looking for vfork.h - not found
-- Looking for ws2tcpip.h
-- Looking for ws2tcpip.h - not found
-- Looking for arpa/inet.h
-- Looking for arpa/inet.h - found
-- Looking for stdint.h
-- Looking for stdint.h - found
-- Looking for stddef.h
-- Looking for stddef.h - found
-- Looking for sys/types.h
-- Looking for sys/types.h - found
-- Looking for gettimeofday
-- Looking for gettimeofday - found
-- Looking for vfork
-- Looking for vfork - found
-- Looking for vprintf
-- Looking for vprintf - found
-- Looking for mmap
-- Looking for mmap - found
-- Looking for fork
-- Looking for fork - found
-- Looking for ftime
-- Looking for ftime - found
-- Looking for gethostbyname
-- Looking for gethostbyname - found
-- Looking for gethostname
-- Looking for gethostname - found
-- Looking for inet_ntoa
-- Looking for inet_ntoa - found
-- Looking for memmove
-- Looking for memmove - found
-- Looking for memset
-- Looking for memset - found
-- Looking for mkfifo
-- Looking for mkfifo - found
-- Looking for select
-- Looking for select - found
-- Looking for socket
-- Looking for socket - found
-- Looking for strchr
-- Looking for strchr - found
-- Looking for strcspn
-- Looking for strcspn - found
-- Looking for strdup
-- Looking for strdup - found
-- Looking for strerror
-- Looking for strerror - found
-- Looking for strstr
-- Looking for strstr - found
-- Looking for htobe64
-- Looking for htobe64 - found
-- Looking for OSSwapHostToBigInt64
-- Looking for OSSwapHostToBigInt64 - not found
-- Building crypto with builtin functions, only including SHA1 and D3DES
-- Threads support is using pthreads
-- Check size of pid_t
-- Check size of pid_t - done
-- Check size of size_t
-- Check size of size_t - done
-- Check size of socklen_t
-- Check size of socklen_t - done
-- Check size of in_addr_t
-- Check size of in_addr_t - done
-- Check if the system is big endian
-- Searching 16 bit integer
-- Check size of unsigned short
-- Check size of unsigned short - done
-- Searching 16 bit integer - Using unsigned short
-- Check if the system is big endian - little endian
-- Building TLS with GnuTLS
-- Configuring done
-- Generating done
-- Build files have been written to: /root/libvncserver/build
[root#localhost build]# cmake --build .
Scanning dependencies of target vncclient
[ 1%] Building C object CMakeFiles/vncclient.dir/libvncclient/cursor.c.o
[ 2%] Building C object CMakeFiles/vncclient.dir/libvncclient/listen.c.o
[ 3%] Building C object CMakeFiles/vncclient.dir/libvncclient/rfbproto.c.o
[ 4%] Building C object CMakeFiles/vncclient.dir/libvncclient/sockets.c.o
[ 5%] Building C object CMakeFiles/vncclient.dir/libvncclient/vncviewer.c.o
[ 6%] Building C object CMakeFiles/vncclient.dir/common/crypto_included.c.o
[ 7%] Building C object CMakeFiles/vncclient.dir/common/sha1.c.o
[ 8%] Building C object CMakeFiles/vncclient.dir/common/d3des.c.o
[ 8%] Building C object CMakeFiles/vncclient.dir/common/turbojpeg.c.o
[ 9%] Building C object CMakeFiles/vncclient.dir/libvncclient/tls_gnutls.c.o
[ 10%] Linking C shared library libvncclient.so
[ 10%] Built target vncclient
Scanning dependencies of target vncserver
[ 11%] Building C object CMakeFiles/vncserver.dir/libvncserver/main.c.o
[ 12%] Building C object CMakeFiles/vncserver.dir/libvncserver/rfbserver.c.o
/root/libvncserver/libvncserver/rfbserver.c: In function ‘rfbProcessExtendedServerCutTextData’:
/root/libvncserver/libvncserver/rfbserver.c:2134:20: warning: assignment discards ‘const’ qualifier from pointer target type [enabled by default]
stream.next_in = data;
^
[ 13%] Building C object CMakeFiles/vncserver.dir/libvncserver/rfbregion.c.o
[ 14%] Building C object CMakeFiles/vncserver.dir/libvncserver/auth.c.o
[ 15%] Building C object CMakeFiles/vncserver.dir/libvncserver/sockets.c.o
[ 16%] Building C object CMakeFiles/vncserver.dir/libvncserver/stats.c.o
[ 17%] Building C object CMakeFiles/vncserver.dir/libvncserver/corre.c.o
[ 18%] Building C object CMakeFiles/vncserver.dir/libvncserver/hextile.c.o
[ 19%] Building C object CMakeFiles/vncserver.dir/libvncserver/rre.c.o
[ 20%] Building C object CMakeFiles/vncserver.dir/libvncserver/translate.c.o
[ 21%] Building C object CMakeFiles/vncserver.dir/libvncserver/cutpaste.c.o
[ 21%] Building C object CMakeFiles/vncserver.dir/libvncserver/httpd.c.o
[ 22%] Building C object CMakeFiles/vncserver.dir/libvncserver/cursor.c.o
[ 23%] Building C object CMakeFiles/vncserver.dir/libvncserver/font.c.o
[ 24%] Building C object CMakeFiles/vncserver.dir/libvncserver/draw.c.o
[ 25%] Building C object CMakeFiles/vncserver.dir/libvncserver/selbox.c.o
[ 26%] Building C object CMakeFiles/vncserver.dir/common/vncauth.c.o
[ 27%] Building C object CMakeFiles/vncserver.dir/libvncserver/cargs.c.o
[ 28%] Building C object CMakeFiles/vncserver.dir/libvncserver/ultra.c.o
[ 29%] Building C object CMakeFiles/vncserver.dir/libvncserver/scale.c.o
[ 30%] Building C object CMakeFiles/vncserver.dir/common/crypto_included.c.o
[ 31%] Building C object CMakeFiles/vncserver.dir/common/sha1.c.o
[ 32%] Building C object CMakeFiles/vncserver.dir/common/d3des.c.o
[ 33%] Building C object CMakeFiles/vncserver.dir/libvncserver/rfbssl_gnutls.c.o
[ 33%] Building C object CMakeFiles/vncserver.dir/libvncserver/zlib.c.o
[ 34%] Building C object CMakeFiles/vncserver.dir/libvncserver/zrle.c.o
[ 35%] Building C object CMakeFiles/vncserver.dir/libvncserver/zrleoutstream.c.o
[ 36%] Building C object CMakeFiles/vncserver.dir/libvncserver/zrlepalettehelper.c.o
[ 37%] Building C object CMakeFiles/vncserver.dir/libvncserver/tight.c.o
[ 38%] Building C object CMakeFiles/vncserver.dir/common/turbojpeg.c.o
[ 39%] Building C object CMakeFiles/vncserver.dir/libvncserver/tightvnc-filetransfer/rfbtightserver.c.o
[ 40%] Building C object CMakeFiles/vncserver.dir/libvncserver/tightvnc-filetransfer/handlefiletransferrequest.c.o
[ 41%] Building C object CMakeFiles/vncserver.dir/libvncserver/tightvnc-filetransfer/filetransfermsg.c.o
[ 42%] Building C object CMakeFiles/vncserver.dir/libvncserver/tightvnc-filetransfer/filelistinfo.c.o
[ 43%] Building C object CMakeFiles/vncserver.dir/libvncserver/websockets.c.o
[ 44%] Building C object CMakeFiles/vncserver.dir/libvncserver/ws_decode.c.o
[ 45%] Building C object CMakeFiles/vncserver.dir/common/base64.c.o
[ 46%] Linking C shared library libvncserver.so
[ 46%] Built target vncserver
Scanning dependencies of target test_tjbench
[ 47%] Building C object CMakeFiles/test_tjbench.dir/test/tjbench.c.o
[ 48%] Building C object CMakeFiles/test_tjbench.dir/test/tjutil.c.o
[ 49%] Building C object CMakeFiles/test_tjbench.dir/test/bmp.c.o
[ 50%] Building C object CMakeFiles/test_tjbench.dir/common/turbojpeg.c.o
[ 51%] Linking C executable test/tjbench
[ 51%] Built target test_tjbench
Scanning dependencies of target test_copyrecttest
[ 52%] Building C object CMakeFiles/test_copyrecttest.dir/test/copyrecttest.c.o
[ 53%] Linking C executable test/copyrecttest
[ 53%] Built target test_copyrecttest
Scanning dependencies of target test_cargstest
[ 54%] Building C object CMakeFiles/test_cargstest.dir/test/cargstest.c.o
[ 55%] Linking C executable test/cargstest
[ 55%] Built target test_cargstest
Scanning dependencies of target client_examples_gtkvncviewer
[ 56%] Building C object CMakeFiles/client_examples_gtkvncviewer.dir/client_examples/gtkvncviewer.c.o
[ 57%] Linking C executable client_examples/gtkvncviewer
[ 57%] Built target client_examples_gtkvncviewer
Scanning dependencies of target test_wstest
[ 58%] Building C object CMakeFiles/test_wstest.dir/test/wstest.c.o
[ 59%] Linking C executable test/wstest
[ 59%] Built target test_wstest
Scanning dependencies of target examples_fontsel
[ 60%] Building C object CMakeFiles/examples_fontsel.dir/examples/fontsel.c.o
[ 61%] Linking C executable examples/fontsel
[ 61%] Built target examples_fontsel
Scanning dependencies of target examples_pnmshow24
[ 62%] Building C object CMakeFiles/examples_pnmshow24.dir/examples/pnmshow24.c.o
[ 62%] Linking C executable examples/pnmshow24
[ 62%] Built target examples_pnmshow24
Scanning dependencies of target copy-compile-commands
[ 62%] Built target copy-compile-commands
Scanning dependencies of target examples_regiontest
[ 63%] Building C object CMakeFiles/examples_regiontest.dir/examples/regiontest.c.o
[ 64%] Linking C executable examples/regiontest
[ 64%] Built target examples_regiontest
Scanning dependencies of target examples_cursors
[ 65%] Building C object CMakeFiles/examples_cursors.dir/examples/cursors.c.o
[ 66%] Linking C executable examples/cursors
[ 66%] Built target examples_cursors
Scanning dependencies of target examples_camera
[ 67%] Building C object CMakeFiles/examples_camera.dir/examples/camera.c.o
[ 67%] Linking C executable examples/camera
[ 67%] Built target examples_camera
Scanning dependencies of target examples_backchannel
[ 68%] Building C object CMakeFiles/examples_backchannel.dir/examples/backchannel.c.o
[ 69%] Linking C executable examples/backchannel
[ 69%] Built target examples_backchannel
Scanning dependencies of target examples_vncev
[ 69%] Building C object CMakeFiles/examples_vncev.dir/examples/vncev.c.o
[ 70%] Linking C executable examples/vncev
[ 70%] Built target examples_vncev
Scanning dependencies of target client_examples_SDLvncviewer
[ 70%] Building C object CMakeFiles/client_examples_SDLvncviewer.dir/client_examples/SDLvncviewer.c.o
[ 71%] Linking C executable client_examples/SDLvncviewer
[ 71%] Built target client_examples_SDLvncviewer
Scanning dependencies of target examples_pnmshow
[ 72%] Building C object CMakeFiles/examples_pnmshow.dir/examples/pnmshow.c.o
[ 73%] Linking C executable examples/pnmshow
[ 73%] Built target examples_pnmshow
Scanning dependencies of target examples_colourmaptest
[ 74%] Building C object CMakeFiles/examples_colourmaptest.dir/examples/colourmaptest.c.o
[ 75%] Linking C executable examples/colourmaptest
[ 75%] Built target examples_colourmaptest
Scanning dependencies of target test_encodingstest
[ 76%] Building C object CMakeFiles/test_encodingstest.dir/test/encodingstest.c.o
[ 77%] Linking C executable test/encodingstest
[ 77%] Built target test_encodingstest
Scanning dependencies of target examples_example
[ 78%] Building C object CMakeFiles/examples_example.dir/examples/example.c.o
[ 79%] Linking C executable examples/example
[ 79%] Built target examples_example
Scanning dependencies of target examples_blooptest
[ 80%] Building C object CMakeFiles/examples_blooptest.dir/examples/blooptest.c.o
[ 81%] Linking C executable examples/blooptest
[ 81%] Built target examples_blooptest
Scanning dependencies of target examples_repeater
[ 82%] Building C object CMakeFiles/examples_repeater.dir/examples/repeater.c.o
[ 83%] Linking C executable examples/repeater
[ 83%] Built target examples_repeater
Scanning dependencies of target test_tjunittest
[ 84%] Building C object CMakeFiles/test_tjunittest.dir/test/tjunittest.c.o
[ 84%] Building C object CMakeFiles/test_tjunittest.dir/test/tjutil.c.o
[ 85%] Building C object CMakeFiles/test_tjunittest.dir/common/turbojpeg.c.o
[ 86%] Linking C executable test/tjunittest
[ 86%] Built target test_tjunittest
Scanning dependencies of target examples_rotate
[ 87%] Building C object CMakeFiles/examples_rotate.dir/examples/rotate.c.o
[ 88%] Linking C executable examples/rotate
[ 88%] Built target examples_rotate
Scanning dependencies of target examples_simple
[ 89%] Building C object CMakeFiles/examples_simple.dir/examples/simple.c.o
[ 90%] Linking C executable examples/simple
[ 90%] Built target examples_simple
Scanning dependencies of target examples_simple15
[ 91%] Building C object CMakeFiles/examples_simple15.dir/examples/simple15.c.o
[ 92%] Linking C executable examples/simple15
[ 92%] Built target examples_simple15
Scanning dependencies of target examples_storepasswd
[ 93%] Building C object CMakeFiles/examples_storepasswd.dir/examples/storepasswd.c.o
[ 94%] Linking C executable examples/storepasswd
[ 94%] Built target examples_storepasswd
Scanning dependencies of target examples_filetransfer
[ 95%] Building C object CMakeFiles/examples_filetransfer.dir/examples/filetransfer.c.o
[ 96%] Linking C executable examples/filetransfer
[ 96%] Built target examples_filetransfer
Scanning dependencies of target client_examples_backchannel
[ 97%] Building C object CMakeFiles/client_examples_backchannel.dir/client_examples/backchannel.c.o
[ 98%] Linking C executable client_examples/backchannel
[ 98%] Built target client_examples_backchannel
Scanning dependencies of target client_examples_ppmtest
[ 99%] Building C object CMakeFiles/client_examples_ppmtest.dir/client_examples/ppmtest.c.o
[100%] Linking C executable client_examples/ppmtest
[100%] Built target client_examples_ppmtest
[root#localhost build]# make
[ 10%] Built target vncclient
[ 46%] Built target vncserver
[ 51%] Built target test_tjbench
[ 53%] Built target test_copyrecttest
[ 55%] Built target test_cargstest
[ 57%] Built target client_examples_gtkvncviewer
[ 59%] Built target test_wstest
[ 61%] Built target examples_fontsel
[ 62%] Built target examples_pnmshow24
[ 62%] Built target copy-compile-commands
[ 64%] Built target examples_regiontest
[ 66%] Built target examples_cursors
[ 67%] Built target examples_camera
[ 69%] Built target examples_backchannel
[ 70%] Built target examples_vncev
[ 71%] Built target client_examples_SDLvncviewer
[ 73%] Built target examples_pnmshow
[ 75%] Built target examples_colourmaptest
[ 77%] Built target test_encodingstest
[ 79%] Built target examples_example
[ 81%] Built target examples_blooptest
[ 83%] Built target examples_repeater
[ 86%] Built target test_tjunittest
[ 88%] Built target examples_rotate
[ 90%] Built target examples_simple
[ 92%] Built target examples_simple15
[ 94%] Built target examples_storepasswd
[ 96%] Built target examples_filetransfer
[ 98%] Built target client_examples_backchannel
[100%] Built target client_examples_ppmtest
[root#localhost build]# make test
Running tests...
Test project /root/libvncserver/build
Start 1: cargs
1/4 Test #1: cargs ............................ Passed 0.01 sec
Start 2: includetest
2/4 Test #2: includetest ...................... Passed 0.62 sec
Start 3: turbojpeg
3/4 Test #3: turbojpeg ........................ Passed 6.17 sec
Start 4: wstest
4/4 Test #4: wstest ........................... Passed 0.01 sec
100% tests passed, 0 tests failed out of 4
Total Test time (real) = 6.82 sec
[root#localhost build]# make install
[ 10%] Built target vncclient
[ 46%] Built target vncserver
[ 51%] Built target test_tjbench
[ 53%] Built target test_copyrecttest
[ 55%] Built target test_cargstest
[ 57%] Built target client_examples_gtkvncviewer
[ 59%] Built target test_wstest
[ 61%] Built target examples_fontsel
[ 62%] Built target examples_pnmshow24
[ 62%] Built target copy-compile-commands
[ 64%] Built target examples_regiontest
[ 66%] Built target examples_cursors
[ 67%] Built target examples_camera
[ 69%] Built target examples_backchannel
[ 70%] Built target examples_vncev
[ 71%] Built target client_examples_SDLvncviewer
[ 73%] Built target examples_pnmshow
[ 75%] Built target examples_colourmaptest
[ 77%] Built target test_encodingstest
[ 79%] Built target examples_example
[ 81%] Built target examples_blooptest
[ 83%] Built target examples_repeater
[ 86%] Built target test_tjunittest
[ 88%] Built target examples_rotate
[ 90%] Built target examples_simple
[ 92%] Built target examples_simple15
[ 94%] Built target examples_storepasswd
[ 96%] Built target examples_filetransfer
[ 98%] Built target client_examples_backchannel
[100%] Built target client_examples_ppmtest
Install the project...
-- Install configuration: ""
-- Installing: /usr/local/lib64/libvncclient.so.0.9.13
-- Up-to-date: /usr/local/lib64/libvncclient.so.1
-- Up-to-date: /usr/local/lib64/libvncclient.so
-- Up-to-date: /usr/local/include/rfb/keysym.h
-- Up-to-date: /usr/local/include/rfb/threading.h
-- Up-to-date: /usr/local/include/rfb/rfb.h
-- Up-to-date: /usr/local/include/rfb/rfbclient.h
-- Installing: /usr/local/include/rfb/rfbconfig.h
-- Up-to-date: /usr/local/include/rfb/rfbproto.h
-- Up-to-date: /usr/local/include/rfb/rfbregion.h
-- Installing: /usr/local/lib64/libvncserver.so.0.9.13
-- Up-to-date: /usr/local/lib64/libvncserver.so.1
-- Up-to-date: /usr/local/lib64/libvncserver.so
-- Up-to-date: /usr/local/include/rfb/keysym.h
-- Up-to-date: /usr/local/include/rfb/threading.h
-- Up-to-date: /usr/local/include/rfb/rfb.h
-- Up-to-date: /usr/local/include/rfb/rfbclient.h
-- Up-to-date: /usr/local/include/rfb/rfbconfig.h
-- Up-to-date: /usr/local/include/rfb/rfbproto.h
-- Up-to-date: /usr/local/include/rfb/rfbregion.h
-- Installing: /usr/local/lib64/cmake/LibVNCServer/LibVNCServerTargets.cmake
-- Installing: /usr/local/lib64/cmake/LibVNCServer/LibVNCServerTargets-noconfig.cmake
-- Installing: /usr/local/lib64/cmake/LibVNCServer/LibVNCServerConfigVersion.cmake
-- Installing: /usr/local/lib64/cmake/LibVNCServer/LibVNCServerConfig.cmake
-- Installing: /usr/local/lib64/pkgconfig/libvncserver.pc
-- Installing: /usr/local/lib64/pkgconfig/libvncclient.pc
------------------------------------------------
guacamole-server version 1.2.0
------------------------------------------------
Library status:
freerdp2 ............ yes
pango ............... yes
libavcodec .......... yes
libavformat.......... yes
libavutil ........... yes
libssh2 ............. yes
libssl .............. yes
libswscale .......... yes
libtelnet ........... yes
libVNCServer ........ yes
libvorbis ........... yes
libpulse ............ yes
libwebsockets ....... yes
libwebp ............. yes
wsock32 ............. no
Protocol support:
Kubernetes .... yes
RDP ........... yes
SSH ........... yes
Telnet ........ yes
Rlogin ........ yes
VNC ........... yes
Services / tools:
guacd ...... yes
guacenc .... yes
guaclog .... yes
FreeRDP plugins: /usr/lib64/freerdp2
Init scripts: /etc/init.d
Systemd units: no
Type "make" to compile guacamole-server.
Below is guacd log when I try to connect TigerVNC Server via Guacamole.
Jan 13 17:33:42 localhost guacd[19563]: Creating new client for protocol "vnc"
Jan 13 17:33:42 localhost guacd[19563]: Connection ID is "$83a2d4dd-24cc-441a-af1e-66a0e429639c"
Jan 13 17:33:42 localhost guacd[31041]: Cursor rendering: local
Jan 13 17:33:42 localhost guacd[31041]: User "#9cdcd7df-1d51-498f-bb4b-2399d1a1b8de" joined connection "$83a2d4dd-24cc-441a-af1e-66a0e429639c" (1 users now present)
Jan 13 17:33:42 localhost guacd[31041]: VNC server supports protocol version 3.8 (viewer 3.8)
Jan 13 17:33:42 localhost guacd[31041]: We have 2 security types to read
Jan 13 17:33:42 localhost guacd[31041]: 0) Received security type 19
Jan 13 17:33:42 localhost guacd[31041]: Selecting security type 19 (0/2 in the list)
Jan 13 17:33:42 localhost guacd[31041]: 1) Received security type 19
Jan 13 17:33:42 localhost guacd[31041]: Selected Security Scheme 19
Jan 13 17:33:42 localhost guacd[31041]: TLS is not supported.
Jan 13 17:33:42 localhost guacd[31041]: Connect failed. Waiting 1000ms before retrying...
Jan 13 17:33:43 localhost guacd[31041]: VNC server supports protocol version 3.8 (viewer 3.8)
Jan 13 17:33:43 localhost guacd[31041]: We have 2 security types to read
Jan 13 17:33:43 localhost guacd[31041]: 0) Received security type 19
Jan 13 17:33:43 localhost guacd[31041]: Selecting security type 19 (0/2 in the list)
Jan 13 17:33:43 localhost guacd[31041]: 1) Received security type 19
Jan 13 17:33:43 localhost guacd[31041]: Selected Security Scheme 19
Jan 13 17:33:43 localhost guacd[31041]: TLS is not supported.
Jan 13 17:33:43 localhost guacd[31041]: Connect failed. Waiting 1000ms before retrying...
Jan 13 17:33:44 localhost guacd[31041]: VNC server supports protocol version 3.8 (viewer 3.8)
Jan 13 17:33:44 localhost guacd[31041]: We have 2 security types to read
Jan 13 17:33:44 localhost guacd[31041]: 0) Received security type 19
Jan 13 17:33:44 localhost guacd[31041]: Selecting security type 19 (0/2 in the list)
Jan 13 17:33:44 localhost guacd[31041]: 1) Received security type 19
Jan 13 17:33:44 localhost guacd[31041]: Selected Security Scheme 19
Jan 13 17:33:44 localhost guacd[31041]: TLS is not supported.
Jan 13 17:33:44 localhost guacd[31041]: Connect failed. Waiting 1000ms before retrying...
Jan 13 17:33:45 localhost guacd[31041]: VNC server supports protocol version 3.8 (viewer 3.8)
Jan 13 17:33:45 localhost guacd[31041]: We have 2 security types to read
Jan 13 17:33:45 localhost guacd[31041]: 0) Received security type 19
Jan 13 17:33:45 localhost guacd[31041]: Selecting security type 19 (0/2 in the list)
Jan 13 17:33:45 localhost guacd[31041]: 1) Received security type 19
Jan 13 17:33:45 localhost guacd[31041]: Selected Security Scheme 19
Jan 13 17:33:45 localhost guacd[31041]: TLS is not supported.
Jan 13 17:33:45 localhost guacd[31041]: Unable to connect to VNC server.
Jan 13 17:33:45 localhost guacd[31041]: User "#9cdcd7df-1d51-498f-bb4b-2399d1a1b8de" disconnected (0 users remain)
Jan 13 17:33:45 localhost guacd[31041]: Last user of connection "$83a2d4dd-24cc-441a-af1e-66a0e429639c" disconnected
Jan 13 17:33:47 localhost guacd[19563]: Connection "$83a2d4dd-24cc-441a-af1e-66a0e429639c" removed.
I cannot find any error log during make and make install.
What can I do further for encrypting my VNC connection?
Don't consider this a proper answer because it probably won't solve your issue.
Actually it works for me:
I have started TigerVNC v1.11.0 like this:
vncserver -geometry 1024x768 -SecurityTypes TLSVnc -alwaysshared :1
Log:
$ cat ~/.vnc/debian:5901.log
Sat Jun 25 19:39:46 2022
Connections: accepted: 127.0.0.1::47286
SConnection: Client needs protocol version 3.8
SConnection: Client requests security type VeNCrypt(19)
SVeNCrypt: Client requests security type TLSVnc (258)
Sat Jun 25 19:39:48 2022
VNCSConnST: Server default pixel format depth 24 (32bpp) little-endian rgb888
VNCSConnST: Client pixel format depth 24 (32bpp) little-endian rgb888
I am using Guacamole v1.3.0. Log:
# journalctl -u guacd.service
Jun 25 19:39:46 debian guacd[270122]: Creating new client for protocol "vnc"
Jun 25 19:39:46 debian guacd[270122]: Connection ID is "$14bc9889-ad11-4457-96ee-091f1f06455c"
Jun 25 19:39:46 debian guacd[892713]: Cursor rendering: local
Jun 25 19:39:46 debian guacd[892713]: User "#549da414-67b2-4679-968d-216c11142a74" joined connection "$14bc9889-ad11-4457-96ee-091f1f06455c" (1 users now present)
Jun 25 19:39:46 debian guacd[892713]: Using non-standard VNC clipboard encoding: 'UTF-8'.
Jun 25 19:39:46 debian guacd[892713]: VNC server supports protocol version 3.8 (viewer 3.8)
Jun 25 19:39:46 debian guacd[892713]: We have 1 security types to read
Jun 25 19:39:46 debian guacd[892713]: 0) Received security type 19
Jun 25 19:39:46 debian guacd[892713]: Selecting security type 19 (0/1 in the list)
Jun 25 19:39:46 debian guacd[892713]: Selected Security Scheme 19
Jun 25 19:39:46 debian guacd[892713]: GnuTLS version 3.7.1 initialized.
Jun 25 19:39:46 debian guacd[892713]: Got VeNCrypt version 0.2 from server.
Jun 25 19:39:46 debian guacd[892713]: We have 1 security types to read
Jun 25 19:39:46 debian guacd[892713]: 0) Received security type 258
Jun 25 19:39:46 debian guacd[892713]: Selecting security type 258 (0/1 in the list)
Jun 25 19:39:46 debian guacd[892713]: TLS session initialized.
Jun 25 19:39:46 debian guacd[892713]: TLS anonymous credential created.
Jun 25 19:39:46 debian guacd[892713]: TLS handshake blocking.
Jun 25 19:39:47 debian guacd[892713]: TLS handshake blocking.
Jun 25 19:39:48 debian guacd[892713]: TLS handshake done.
Jun 25 19:39:48 debian guacd[892713]: Libgcrypt warning: missing initialization - please fix the application
Jun 25 19:39:48 debian guacd[892713]: VNC authentication succeeded
I don't think that SSL library plays a role, but just in case stock guacd is linked against OpenSSL:
# ldd `which guacd`
libcrypto.so.1.1 => /lib/x86_64-linux-gnu/libcrypto.so.1.1 (0x00007fabf9992000)
libssl.so.1.1 => /lib/x86_64-linux-gnu/libssl.so.1.1 (0x00007fabfa0ac000)
So I suggest you to try to upgrade TigerVNC first (as it seems to be the easiest in your case). If that does not help, then try stock guacd.

hashcat benchmark not starting at all

I'm trying to start hashcat on Win10 using my GPU AMD RX580.
What I did so far is:
Uninstalled all AMD drivers and rebooted
Started Driver Fusion cleaned all AMD Display drivers and rebooted
Manually removed OpenCL.dll from C:\windows\system32\ and c:\windows\syswow64 and rebooted
Installed AMD Crimsson driver edition - tried 17.8.2, 17.11.1, 17.11.4
My problem:
When I try to start a benchmark for WPA2 hash with PS D:\crack\hashcat-5.1.0> .\hashcat64.exe -m 2500 -b
It starts and just quits without any output:
PS D:\crack\hashcat-5.1.0> .\hashcat64.exe -m 2500 -b
hashcat (v5.1.0) starting in benchmark mode...
Benchmarking uses hand-optimized kernel code by default.
You can use it in your cracking session by setting the -O option.
Note: Using optimized kernel code limits the maximum supported password length.
To disable the optimized kernel code in benchmark mode, use the -w option.
* Device #2: Not a native Intel OpenCL runtime. Expect massive speed loss.
You can use --force to override, but do not report related errors.
OpenCL Platform #1: Advanced Micro Devices, Inc.
================================================
* Device #1: Ellesmere, 3264/4096 MB allocatable, 36MCU
* Device #2: Intel(R) Core(TM) i7-4790 CPU # 3.60GHz, skipped.
Benchmark relevant options:
===========================
* --optimized-kernel-enable
Hashmode: 2500 - WPA-EAPOL-PBKDF2 (Iterations: 4096)
PS D:\crack\hashcat-5.1.0>
Output from hashcat -I:
PS D:\crack\hashcat-5.1.0> .\hashcat64.exe -I
hashcat (v5.1.0) starting...
OpenCL Info:
Platform ID #1
Vendor : Advanced Micro Devices, Inc.
Name : AMD Accelerated Parallel Processing
Version : OpenCL 2.0 AMD-APP (2442.8)
Device ID #1
Type : GPU
Vendor ID : 1
Vendor : Advanced Micro Devices, Inc.
Name : Ellesmere
Version : OpenCL 2.0 AMD-APP (2442.8)
Processor(s) : 36
Clock : 1366
Memory : 3264/4096 MB allocatable
OpenCL Version : OpenCL C 2.0
Driver Version : 2442.8
Device ID #2
Type : CPU
Vendor ID : 128
Vendor : GenuineIntel
Name : Intel(R) Core(TM) i7-4790 CPU # 3.60GHz
Version : OpenCL 1.2 AMD-APP (2442.8)
Processor(s) : 8
Clock : 3599
Memory : 6131/24526 MB allocatable
OpenCL Version : OpenCL C 1.2
Driver Version : 2442.8 (sse2,avx)
PS D:\crack\hashcat-5.1.0>
The same happens if I try to start mask attack.
Other benchmarks seems to work but when it reaches the WPA2 it just returns me to the command prompt:
PS D:\crack\hashcat-5.1.0> .\hashcat64.exe -b
hashcat (v5.1.0) starting in benchmark mode...
Benchmarking uses hand-optimized kernel code by default.
You can use it in your cracking session by setting the -O option.
Note: Using optimized kernel code limits the maximum supported password length.
To disable the optimized kernel code in benchmark mode, use the -w option.
* Device #2: Not a native Intel OpenCL runtime. Expect massive speed loss.
You can use --force to override, but do not report related errors.
OpenCL Platform #1: Advanced Micro Devices, Inc.
================================================
* Device #1: Ellesmere, 3264/4096 MB allocatable, 36MCU
* Device #2: Intel(R) Core(TM) i7-4790 CPU # 3.60GHz, skipped.
Benchmark relevant options:
===========================
* --optimized-kernel-enable
Hashmode: 0 - MD5
Speed.#1.........: 12381.1 MH/s (96.87ms) # Accel:256 Loops:512 Thr:256 Vec:1
Hashmode: 100 - SHA1
Speed.#1.........: 4268.9 MH/s (70.02ms) # Accel:256 Loops:128 Thr:256 Vec:1
Hashmode: 1400 - SHA2-256
Speed.#1.........: 1870.1 MH/s (80.00ms) # Accel:256 Loops:64 Thr:256 Vec:1
Hashmode: 1700 - SHA2-512
Speed.#1.........: 461.1 MH/s (81.22ms) # Accel:128 Loops:32 Thr:256 Vec:1
Hashmode: 2500 - WPA-EAPOL-PBKDF2 (Iterations: 4096)
PS D:\crack\hashcat-5.1.0>
Any idea what could cause this behavior?
It looks like it was a crash in the OpenCL runtime. I have installed the newest Adrenalin Drivers - 19.3.2 , but went into another issue :
PS D:\crack\hashcat-5.1.0> .\hashcat64.exe -b -m 2500
hashcat (v5.1.0) starting in benchmark mode...
Benchmarking uses hand-optimized kernel code by default.
You can use it in your cracking session by setting the -O option.
Note: Using optimized kernel code limits the maximum supported password length.
To disable the optimized kernel code in benchmark mode, use the -w option.
OpenCL Platform #1: Advanced Micro Devices, Inc.
================================================
* Device #1: Ellesmere, 3264/4096 MB allocatable, 36MCU
Benchmark relevant options:
===========================
* --optimized-kernel-enable
Hashmode: 2500 - WPA-EAPOL-PBKDF2 (Iterations: 4096)
* Device #1: ATTENTION! OpenCL kernel self-test failed.
Your device driver installation is probably broken.
See also: https://hashcat.net/faq/wrongdriver
Speed.#1.........: 179.3 kH/s (87.14ms) # Accel:128 Loops:64 Thr:256 Vec:1
Started: Mon Mar 18 19:05:55 2019
Stopped: Mon Mar 18 19:06:26 2019
PS D:\crack\hashcat-5.1.0>
Then I used the --self-test-disable option and it started . I have also created a post in the hashcat forum : https://hashcat.net/forum/thread-8226-post-44141.html#pid44141 in case anyone is interested .

How to set KVM VM use shadow page table?

I want to measure shadow page table performance vs EPT. I know in kvm code path, EPT and shadow page table share some code path. There is a switch to check if EPT is enabled.
So, I turn off EPT, I think this is a way to use shadow page table in KVM VM.
I exec some commands on host:
# cat /sys/module/kvm_intel/parameters/ept
Y //check if EPT is enabled, Yes it is
# rmmod kvm_intel
# modprobe kvm_intel ept=0,vpid=0 //Re-modprobe kvm_intel, but turn off EPT and VPID
# cat /sys/module/kvm_intel/parameters/ept
N // EPT is disabled
# cat /sys/module/kvm_intel/parameters/vpid
Y //VPID is still enabled
After these commads, I expect the EPT is disabled, However, I create a VM with 4 vcpu, but in VM, I use htop in VM only find i vcpu. I don't know why.
So, I turn on ept again, I can see 4 vcpu in vm using htop. But, on another server, I turn off ept, in VM, I still can find 4 vcpu.
In host, I test qemu thread num:
pstree -p | grep qemu
|-qemu-kvm(20594)-+-{qemu-kvm}(20612)
| |-{qemu-kvm}(20613)
| |-{qemu-kvm}(20614)
| |-{qemu-kvm}(20615)
| |-{qemu-kvm}(20618)
| `-{qemu-kvm}(23429)
There are still muti threads.
In KVM VM, I use lscpu to check:
# lscpu
Architecture: x86_64
CPU op-mode(s): 32-bit, 64-bit
Byte Order: Little Endian
CPU(s): 4
On-line CPU(s) list: 0
Off-line CPU(s) list: 1-3
Thread(s) per core: 1
Core(s) per socket: 1
座: 1
NUMA 节点: 1
厂商 ID: GenuineIntel
CPU 系列: 6
型号: 62
型号名称: Intel(R) Xeon(R) CPU E5-2640 v2 # 2.00GHz
步进: 4
CPU MHz: 1999.999
BogoMIPS: 3999.99
超管理器厂商: KVM
虚拟化类型: 完全
L1d 缓存: 32K
L1i 缓存: 32K
L2 缓存: 4096K
NUMA 节点0 CPU: 0
Flags: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ss syscall nx pdpe1gb rdtscp lm constant_tsc arch_perfmon rep_good nopl eagerfpu pni pclmulqdq ssse3 cx16 pcid sse4_1 sse4_2 x2apic popcnt tsc_deadline_timer aes xsave avx f16c rdrand hypervisor lahf_lm fsgsbase tsc_adjust smep erms xsaveopt
VPID is still enabled cause your command format was incorrect
# modprobe kvm_intel ept=0 vpid=0(Use spaces instead of commas)

How to build FLAT userspace binary for ucLinux on buildroot with arm2010q1 toolchain

I have a buildroot system for cortex-M3 without MMU based on ucLinux kernel 2.6.33. Support for FLAT, ZFLAT, SHARED_FLAT enabled in kernel.
Inside buildroot everything is set to M3 etc.
I have working system with working kernel and busybox (which is only ok binary in userspace). There are no uClibc on system or any other libs.
I'm trying to build simplest userspace app like this: main(){}
I tried with different flags. Latest combination was like this:
^[[7m>>> zpm_t 1.0 Building^[[27m
/usr/bin/make -j5 FLAGS="-c -mthumb -march=armv7 -mfix-cortex-m3-ldrd" EXTRA_LDFLAGS="-Wl,-elf2flt,--static" CC="/mnt/repos/repos/github/nocturn_buildroot/output/host/usr/bin/ccache /mnt/repos/repos/github/nocturn_buildroot/output/host/usr/bin/arm-uclinuxeabi-gcc" LD="/mnt/repos/repos/github/nocturn_buildroot/output/host/usr/bin/arm-uclinuxeabi-ld" HEADERS="-I/mnt/repos/repos/github/nocturn_buildroot/output/target/usr/include/SDL" LIBS="-L/mnt/repos/repos/github/nocturn_buildroot/../nocturn_tools/arm-2010q1/arm-uclinuxeabi/libc/usr/lib" -C /mnt/repos/repos/github/nocturn_buildroot/output/build/zpm_t-1.0 all
make[1]: Entering directory /mnt/repos/repos/github/nocturn_buildroot/output/build/zpm_t-1.0'
/mnt/repos/repos/github/nocturn_buildroot/output/host/usr/bin/ccache /mnt/repos/repos/github/nocturn_buildroot/output/host/usr/bin/arm-uclinuxeabi-gcc -c -mthumb -march=armv7 -mfix-cortex-m3-ldrd -I/mnt/repos/repos/github/nocturn_buildroot/output/target/usr/include/SDL t.c
/mnt/repos/repos/github/nocturn_buildroot/output/host/usr/bin/ccache /mnt/repos/repos/github/nocturn_buildroot/output/host/usr/bin/arm-uclinuxeabi-gcc -Wl,-elf2flt,--static t.o -L/mnt/repos/repos/github/nocturn_buildroot/../nocturn_tools/arm-2010q1/arm-uclinuxeabi/libc/usr/lib -o t
make[1]: Leaving directory/mnt/repos/repos/github/nocturn_buildroot/output/build/zpm_t-1.0'
flat file seems to be ok:
$ arm-uclinuxeabi-flthdr output/target/opt/t
output/target/opt/t
Magic: bFLT
Rev: 4
Build Date: Wed Sep 24 00:28:31 2014
Entry: 0x45
Data Start: 0x1f00
Data End: 0x1f70
BSS End: 0x1fa0
Stack Size: 0x1000
Reloc Start: 0x1f70
Reloc Count: 0x29
Flags: 0x1 ( Load-to-Ram )
But on system I always have a segfault which is not so informative:
/opt # ./t
[ 23.200000]
[ 23.200000]
[ 23.200000] t: fault at 0xa0501dd4 [pc=0xa0501dd4, sp=0xa0503f28]
[ 23.200000] Invalid ISA state
[ 23.200000]
SEGV
What did I miss? It should be something very simple. Also - what to do with uClibc? Should it be compiled into every binary executable or should I place it on the system somehow?
I have linked my app with wrong library. I had to take pre-built one from thumb2 folder inside toolchain (for M3):
LIBS="-L$(TOPDIR)/../tools/arm-2010q1/arm-uclinuxeabi/libc/thumb2/usr/lib"
Just fixing it helps. As I have libc.a and libm.a as static archives - just fixing LIBS is enough. And no flags like -lm needed. During buildroot compilation it takes needed part of static libs and creates a working FLAT binary.