Here is a quick how-to if you want to try out the new (supposedly fast) C/C++ linker https://github.com/rui314/mold
In this document I used Ubuntu-22.04 docker container with
- GCC version 11.2.0
- Clang version 14.0.0
Here is a quick how-to if you want to try out the new (supposedly fast) C/C++ linker https://github.com/rui314/mold
In this document I used Ubuntu-22.04 docker container with
| // % clang++ $(llvm-config --cxxflags --ldflags --system-libs --libs core) -o hello_world_llvm hello_world_llvm.cpp | |
| // % ./hello_world_llvm | |
| // hello world | |
| #include <llvm/ExecutionEngine/ExecutionEngine.h> | |
| #include <llvm/ExecutionEngine/GenericValue.h> | |
| #include <llvm/IR/IRBuilder.h> | |
| #include <stdio.h> | |
| using namespace llvm; |
| #if 0 | |
| ifneq ($(shell grep -a -h -i microsoft /proc/version),) | |
| # // For use on Windows (WSL) with cygwinX | |
| # // Requires xinit, xauth and xhost probably | |
| # // Start the X11 server with `path\to\cygwin64\bin\run.exe --quote /usr/bin/bash.exe -l -c "cd; exec /usr/bin/startxwin -- +iglx -listen tcp"` | |
| # // If you get "Authorization required, but no authorization protocol specified" | |
| # // then try running `DISPLAY=:0.0 xhost +` in the cygwin terminal after | |
| # // starting the X11 server. | |
| DISPLAY = "`cat /etc/resolv.conf | grep nameserver | awk '{ print $$2 }'`:0.0" | |
| LIBGLARGS = LIBGL_ALWAYS_INDIRECT=1 LIBGL_ALWAYS_SOFTWARE=1 |
| #include <sys/ioctl.h> | |
| #include <stdio.h> | |
| #include <unistd.h> | |
| int | |
| main(void) { | |
| struct winsize ws; | |
| ioctl(STDIN_FILENO, TIOCGWINSZ, &ws); | |
| printf ("lines %d\n", ws.ws_row); |
Using perf:
$ perf record -g binary
$ perf script | stackcollapse-perf.pl | rust-unmangle | flamegraph.pl > flame.svg
NOTE: See @GabrielMajeri's comments below about the
-goption.
| syntax on " enable syntax highlighting | |
| set background=dark " we like it dark! | |
| try | colorscheme gruvbox | catch | endtry " use this awesome theme if possible | |
| highlight Pmenu ctermbg=black guibg=black | " fix popup color so it's easier to read | |
| filetype plugin on " load plugins based on file type | |
| filetype indent on " load indent settings based on file type | |
| set shiftwidth=2 " number of spaces to use for indenting | |
| set softtabstop=2 " number of spaces to use when inserting a tab | |
| set tabstop=2 " show tabs as 2 spaces | |
| set expandtab " convert tabs into spaces |
| -- Remove the history from | |
| rm -rf .git | |
| -- recreate the repos from the current content only | |
| git init | |
| git add . | |
| git commit -m "Initial commit" | |
| -- push to the github remote repos ensuring you overwrite history | |
| git remote add origin git@github.com:<YOUR ACCOUNT>/<YOUR REPOS>.git |