Code Monkey home page Code Monkey logo

publishaotcross's Introduction

Hi there

I'm Michal, I live in Slovakia, and I work remotely at the .NET Runtime team at Microsoft.

In my spare time I work on C#-related side projects that I find fun but don't particularly overlap with my day job. I maintain the bflat compiler - a C# compiler with Go-like tooling to build small and selfconained apps by default. You might also know me from my greatest hits such as "Let's make C# run on Windows 3.11!", "How about a snake game in C# running on DOS?". I also write articles such as the one on how I built a fully self-contained game in C# in 8 kilobytes.

You can follow me on Twitter to see what I'm up to: https://twitter.com/MStrehovsky

If you would like, leave me a tip in my tip jar at https://paypal.me/MichalStrehovsky

publishaotcross's People

Contributors

michalstrehovsky avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

publishaotcross's Issues

Consider using Zig's `objcopy` subcommand

At least since 0.11.0, Zig has an objcopy subcommand, which would eliminate the need for LLVM's llvm-objcopy.

$ zig --help|grep objcopy
  objcopy          Use Zig as a drop-in objcopy
$ zig objcopy --help
Usage: zig objcopy [options] input output

Options:
  -h, --help                  Print this help and exit
  --output-target=<value>     Format of the output file
  -O <value>                  Alias for --output-target
  --only-section=<section>    Remove all but <section>
  -j <value>                  Alias for --only-section
  --pad-to <addr>             Pad the last section up to address <addr>
  --strip-debug, -g           Remove all debug sections from the output.
  --strip-all, -S             Remove all debug sections and symbol table from the output.
  --only-keep-debug           Strip a file, removing contents of any sections that would not be stripped by --strip-debug and leaving the debugging sections intact.
  --add-gnu-debuglink=<file>  Creates a .gnu_debuglink section which contains a reference to <file> and adds it to the output file.
  --extract-to <file>         Extract the removed sections into <file>, and add a .gnu-debuglink section.
  --compress-debug-sections   Compress DWARF debug sections with zlib

Not sure if it has all the functionality that NativeAOT needs, though.

Add support for Linux host

We're currently limited to Windows host because I was lazy to write the clang shim batch file in Bash.

@echo off
@where zig >nul 2>&1
@if ERRORLEVEL 1 (
echo Error: zig is not on the PATH. Install zig and make sure it's on PATH. Follow instructions at https://github.com/MichalStrehovsky/PublishAotCross.
exit /B 1
)
set args=%*
rem Works around zlib not being available with zig. This is not great.
set args=%args:-lz =%
rem Work around a .NET 8 Preview 6 issue
set args=%args:'-Wl,-rpath,$ORIGIN'=-Wl,-rpath,$ORIGIN%
rem Work around parameters unsupported by zig. Just drop them from the command line.
set args=%args:--discard-all=--as-needed%
set args=%args:-Wl,-pie =%
set args=%args:-pie =%
rem Works around zig linker dropping necessary parts of the executable.
set args=-Wl,-u,__Module %args%
rem Run zig cc
zig cc %args%

Windows host is also guarded here:

<Import Project="Crosscompile.targets" Condition="$(RuntimeIdentifier.Contains('linux')) and $([MSBuild]::IsOSPlatform('Windows'))" />

Do something about zlib

The compilation requires zlib if System.IO.Compression is used. We currently unceremoniously drop it on the floor. Things that use zlib probably won't work.

rem Works around zlib not being available with zig. This is not great.
set args=%args:-lz =%

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.