Skip to content

Instantly share code, notes, and snippets.

@tnn2
tnn2 / transpose.c
Created March 1, 2019 08:55
transpose.c
#include <stdio.h>
/*
* transpose8x8(p, q):
*
* Transpose an 8x8 matrix of boolean values.
* The transpose operation switches rows into columns and vice versa.
* The booleans are represented with 1 bit each and packed into 8 bytes
* for a total of 64 bits.
*
[ 1.0549365] pci4 at ppb3 bus 4
[ 1.0549365] machfb0 at pci4 dev 0 function 0: vendor 1002 product 4755 (rev. 0x9a)
[ 1.0549365] machfb0: using MMIO aperture
[ 1.0549365] machfb0: 16 MB aperture at 0xfb000000, 4 KB registers at 0xfafff000
[ 1.0549365] machfb0: 128 KB ROM at 0xfafc0000
ref_div: 33
mclk_fb_div: 138
minref: 392 m: 36
[ 1.0549365] machfb0: 2048 KB EDO DRAM 59.875 MHz, maximum RAMDAC clock 200 MHz
[ 1.0549365] uvm_fault(0xffffffff8152fd18, 0x0, 1) -> e
[Switching to LWP 1]
0x00007f7fe222b9bb in g_type_check_instance_is_fundamentally_a ()
from /usr/pkg/lib/libgobject-2.0.so.0
(gdb) bt
#0 0x00007f7fe222b9bb in g_type_check_instance_is_fundamentally_a ()
from /usr/pkg/lib/libgobject-2.0.so.0
#1 0x00007f7fe221485b in g_object_ref () from /usr/pkg/lib/libgobject-2.0.so.0
#2 0x00007f7fe1a46a5d in g_list_foreach () from /usr/pkg/lib/libglib-2.0.so.0
#3 0x00007f7fec9bfac3 in gtk_window_set_icon_list ()
from /usr/pkg/lib/libgtk-3.so.0
clang -lssl -lcrypto -L/usr/pkgsrc/bootstrap/work/wrk/pkgtools/pkg_install/work/libfetch -L/usr/pkgsrc/bootstrap/work/wrk/pkgtools/pkg_install/work/netpgpverify -L/usr/pkgsrc/bootstrap/work/wrk/pkgtools/pkg_install/work/libnbcompat -L/usr/lib -Wl,-R/usr/lib -Wl,-R/usr/pkg/lib -L../lib -o pkg_add main.o perform.o -linstall -larchive -lfetch -lnetpgpverify -lssl -lcrypto -lnbcompat
/usr/bin/ld: undefined reference to symbol `inflateInit2_@@ZLIB_1.2.4.0' (try adding -lz)
//lib/libz.so.6: could not read symbols: Bad value
clang: error: linker command failed with exit code 1 (use -v to see invocation)
*** [pkg_add] Error code 1
@tnn2
tnn2 / gist:b359756edf6b4094dfd0
Last active August 29, 2015 14:15
Wrong fix don't use
--- Makefile.am.orig 2015-02-19 16:38:09.000000000 +0000
+++ Makefile.am
@@ -96,7 +96,7 @@ endif
# Include THREADDLLIBS here to ensure that the correct versions of
# linuxthread semaphore functions get linked:
-libgc_la_LIBADD = @addobjs@ $(THREADDLLIBS) $(UNWINDLIBS) $(ATOMIC_OPS_LIBS)
+libgc_la_LIBADD = $(echo @addobjs@ | sed s,src/,,) $(THREADDLLIBS) $(UNWINDLIBS) $(ATOMIC_OPS_LIBS)
libgc_la_DEPENDENCIES = @addobjs@
libgc_la_LDFLAGS = $(extra_ldflags_libgc) -version-info 1:3:0 -no-undefined