Skip to content

Instantly share code, notes, and snippets.

💭
🤔

Calvin Buckley NattyNarwhal

View GitHub Profile
View getsign.c
int getsign (register int x) {
register int z;
/* it would be nice not to have to clobber the input, but isel doesn't like r0 */
asm (
"cmpi 0, 0, %2, 0\n"
"addi %2, 0, -1\n"
"isel %0, %2, %0, 0\n" // lt
"addi %2, 0, 1\n"
"isel %0, %2, %0, 1\n" // gt
"addi %2, 0, 0\n"
@NattyNarwhal
NattyNarwhal / patch.diff
Last active Mar 6, 2019
svr4 soname patch (WIP)
View patch.diff

Static mono binary:

CONFIG_SHELL=`which bash` ./autogen.sh  --with-aix-soname=svr4 --enable-shared  --with-static_mono=yes --prefix=/opt/mono

Non-static mono binary:

OBJECT_MODE=64 CONFIG_SHELL=`which bash` LDFLAGS="-Wl,-bnoquiet" ./autogen.sh  --with-aix-soname=svr4 --enable-shared  --with-static_mono=no --disable-static --prefix=/opt/mono
View gist:b993d45afa3048d3a915858fad23259e
(gdb) x/24x 0x10000398
0x10000398 <main+56>: 0x00 0x00 0x00 0x00 0x00 0x00 0x20 0x61
0x100003a0 <main+64>: 0x80 0x01 0x00 0x01 0x00 0x00 0x00 0x38
0x100003a8 <main+72>: 0x00 0x04 0x6d 0x61 0x69 0x6e 0x1f 0x00
(gdb) x/24c 0x10000398
0x10000398 <main+56>: 0 '▒' 0 '▒' 0 '▒' 0 '▒' 0 '▒' 0 '▒' 32 ' ' 97 'a'
0x100003a0 <main+64>: -128 '▒' 1 '▒' 0 '▒' 1 '▒' 0 '▒' 0 '▒' 0 '▒' 56 '8'
0x100003a8 <main+72>: 0 '▒' 4 '▒' 109 'm' 97 'a' 105 'i' 110 'n' 31 '▒' 0 '▒'
https://www.ibm.com/support/knowledgecenter/ssw_aix_71/com.ibm.aix.alangref/idalangref_traceback_tags.htm
@NattyNarwhal
NattyNarwhal / congruent.c
Created Jul 26, 2018
mntctl/statfs congruency
View congruent.c
#include <stdio.h>
#include <stdlib.h>
#include <assert.h>
#include <sys/types.h>
#include <sys/mntctl.h>
#include <sys/vmount.h>
#include <sys/statfs.h>
int main(void) {
int needsize, ret;
View gist:748610dd19d2bf8b2eab1afddbc5d768
$ ./configure
checking for C compiler... cc
checking for -w compiler flag... yes
checking for OS... NEXTSTEP
checking for __dead... no
checking for __dead2... no
checking for asprintf... no
checking for confstr... no
checking for pledge... no
checking for reallocarray... no
View gist:1346e4528a8f86fd6bbb96df9ed8f467
MCS [basic] mscorlib.dll
../../../external/corefx/src/Common/src/CoreLib/System/Collections/Generic/Dictionary.cs(231,22): warning CS0219: The variable `modified' is assigned but its value is never used
../../../external/corefx/src/Common/src/CoreLib/System/Collections/Generic/Dictionary.cs(240,18): warning CS0219: The variable `modified' is assigned but its value is never used
../../../external/corefx/src/Common/src/CoreLib/System/Collections/Generic/List.cs(950,21): warning CS0219: The variable `i' is assigned but its value is never used
../../../external/corefx/src/Common/src/CoreLib/System/Number.Formatting.cs(2125,17): warning CS0219: The variable `i' is assigned but its value is never used
../../../external/corefx/src/Common/src/CoreLib/System/Runtime/InteropServices/MemoryMarshal.cs(70,22): warning CS0219: The variable `localManager' is assigned but its value is never used
../../../external/corefx/src/Common/src/CoreLib/System/Runtime/InteropServices/MemoryMarshal.cs(89,22): warning CS0219: The var
View gist:8eb82ea33f0337d92e0f464afc42b83d
MCS [basic] System.Security.dll
../../../external/corefx/src/Common/src/System/Security/Cryptography/AsnReader.cs(294,21): warning CS0219: The variable `tag' is assigned but its value is never used
../../../external/corefx/src/Common/src/System/Security/Cryptography/AsnReader.cs(317,21): warning CS0219: The variable `tag' is assigned but its value is never used
Unhandled Exception:
Mono.CSharp.InternalErrorException: ../../../external/corefx/src/Common/src/System/Security/Cryptography/AsnWriter.cs(1171,22): System.Security.Cryptography.Asn1.AsnWriter.WriteGeneralizedTimeCore(System.Security.Cryptography.Asn1.Asn1Tag, System.DateTimeOffset, bool) ---> Mono.CSharp.InternalErrorException: ../../../external/corefx/src/Common/src/System/Security/Cryptography/AsnWriter.cs(1172,9): ---> System.OverflowException: Value was either too large or too small for an Int32.
at System.Decimal.ToInt32 (System.Decimal d) [0x00035] in <b639830f9571483488f2a4773dd396f1>:0
at System.Decimal.op_Explicit (System.Decimal val
View gist:d2db27bb64b8c0f9014a428fefbe4054
*** The runtime 'mono' doesn't appear to be usable.
*** Trying the 'monolite-macos/1051700025' directory.
Stacktrace:
at <unknown> <0xffffffff>
at (wrapper managed-to-native) System.Text.EncodingHelper.InternalCodePage (int&) <0x000d8>
at System.Console..cctor () [0x0003c] in <b639830f9571483488f2a4773dd396f1>:0
at (wrapper runtime-invoke) object.runtime_invoke_void (object,intptr,intptr,intptr) [0x0001e] in <b639830f9571483488f2a4773dd396f1>:0
at <unknown> <0xffffffff>
at Mono.CSharp.Driver.Main (string[]) [0x00019] in <77f53e34a92f452696f1d782cddd3779>:0
View stdint.h
/* begin_generated_IBM_copyright_prolog */ /* This is an automatically generated copyright prolog. */ /* After initializing, DO NOT MODIFY OR MOVE */ /* ----------------------------------------------------------------- */ /* */ /* Product(s): */ /* 5722-SS1 */ /* 5761-SS1 */ /* 5770-SS1 */ /* */ /* (C)Copyright IBM Corp. 2005, 2013 */ /* */ /* All rights reserved.
@NattyNarwhal
NattyNarwhal / README.md
Last active Jul 2, 2018
libarchive on AIX
View README.md

Compiles cleanly. I tested against git master. Follow this:

bash build/autogen.sh # if you cloned from git instead of using a release tarball
CONFIG_SHELL=`which bash` AR=/usr/bin/ar NM=/usr/bin/nm LD=/usr/bin/ld ./configure
gmake # you can parallelize this with -j<NUMPROCS> - i recommend setting that to CPU cores

You will have to apply a patch included with this document; a real solution would be to fix it in configure.ac, but this is left as an exercise to the reader.

You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.