Old Blog

Welcome! This *was* my blog at some point.

This blog is a wiki. Feel free to edit any page.

This website is amazing. If you make an edit, then you are amazing as well.

A few people think that some of the stuff I write is offensive. This is not true. If you find it offensive, then there is a problem with your cognitive process.

Non-instructional posts are dedicated to people who can read more than 2 sentences in a row.


2017-10-20 Interesting 6lang – Bug Report Turning Into a Novel

I decided to post about interesting things I notice.

Here's one of the most interesting comments on a bug report I've ever seen:
https://rt.perl.org/Ticket/Display.html?id=128462#txn-1494756

Comments

2016-03-20 Fuck Microchip

TL;DR

  1. Attempt to build XC compiler from source.
  2. Realize that Microchip deliberately excluded some files required for the build.
  3. Try to find these files somewhere on the forum. Realize that this is still not enough because it is crystal clear that the whole thing is uncompilable.
  4. Edit the SHA sum in cc1, cc1plus and lto1 binaries so that it accepts any xclm binary.
  5. Never use Microchip products again.

There's no point to try this, but still…

These instructions are mostly based on this page: http://www.jubatian.com/articles/turning-on-optimizations-in-microchips-xc32/

First you have to download the source of the compiler. Go to http://www.microchip.com/mplab/compilers, click on “Downloads Archive”, scroll down and find “Source Archives”. There you can choose which version to download. At the time of writing the latest link is for xc32-v1.40.

# ⚠ change these variables according to your setup.
installpath="$HOME/microshit" # this is where the compiler will be installed
pic32mxpath='/opt/microchip/xc32/v1.40/pic32mx/' # assuming that you already have installed xc32 from microchip
mkdir -- "$installpath"

export CPPFLAGS="-I$installpath/usr/include"
export LDFLAGS="-L$installpath/usr/lib"
# gmp
mkdir -p gmp_build && cd gmp_build
../gmp/configure "--prefix=$installpath/usr" --disable-shared --enable-static --enable-cxx
make
make install
cd ..
# ppl
mkdir -p ppl_build && cd ppl_build
../ppl/configure "--prefix=$installpath/usr" --disable-shared --enable-static
make
make install
cd ..

Unfortunately I get this error during make:

../../ppl/src/Generator_System.defs.hh:253:7: error: ‘ptrdiff_t’ was not declared in this scope

It seems like it does not compile under newer gcc versions.

This leads me to this page: https://gcc.gnu.org/gcc-4.6/porting_to.html
It says that you should #include <cstddef>. You have to do that with these files:

  • ../ppl/src/Generator_System.defs.hh
  • ../ppl/src/Grid_Generator.cc
  • ../ppl/src/Scalar_Products.cc
  • src/ppl.hh (it is a bit tricky with these auto-generated files. I didn't investigate much, but adding it to line 696 fixes the problem)

Just add #include <cstddef> and save. Now run *make* again.

Now you'll probably see this error:

../../ppl/src/Interval.defs.hh:451:77: error: ‘f_info’ was not declared in this scope, and no declarations were found by argument-dependent lookup at the point of instantiation [-fpermissive]
     Result rl = Boundary_NS::assign(UPPER, upper(), info(), UPPER, x, f_info(x, open));

It looks like it can be solved by using -fpermissive flag.

Try rerunning make like this:

make CXXFLAGS='-g -O2 -frounding-math -W -Wall -fpermissive'

This should probably work.

# cloog
mkdir -p cloog_build && cd cloog_build
../cloog/configure "--prefix=$installpath/usr" --disable-shared --enable-static "--with-ppl=$installpath/usr"
make
make install
cd ..
# libelf
mkdir -p libelf_build && cd libelf_build
../libelf/configure "--prefix=$installpath/usr" --disable-shared
make
make install
cd ..
# zlib
cd zlib
./configure "--prefix=$installpath/usr"
make
make install
cd ..
# binutils
mkdir -p binutils_build && cd binutils_build
../binutils/configure "--prefix=$installpath/usr" --disable-shared --enable-static --target=pic32mx --with-dwarf2
make
make install
cd ..

You will get this error:

../../binutils/bfd/cpu-pic32.c:32:55: fatal error: ../../c30_resource/src/xc32/resource_info.h: No such file or directory

OK this is a real issue. It seems like they forgot to include the file. See this link: http://www.microchip.com/forums/m897811.aspx

# Microchip libraries
cp -a -- "$pic32mxpath" "$installpath/usr/pic32mx"
# gcc
mkdir -p gcc_build && cd gcc_build
../gcc/configure "--prefix=$installpath/usr" --disable-shared --enable-static --target=pic32mx --enable-languages=c,c++,lto --disable-objc-gc --enable-lto --with-host-libstdcxx=-lstdc++ --enable-multilib --with-dwarf2 --disable-sjlj-exceptions "--with-sysroot=$installpath/usr/pic32mx"
make
make install

Uhh… What?

After all these efforts you end up with a half-broken build.

Just edit the SHA sum in cc1, cc1plus and lto1 binaries and you're done. No need to compile anything.

There is a chance that the build process will become easier once Microchip updates their compiler to the latest GCC version. Latest XC compiler version is 1.40 (2015-06-17), which is pretty old. The reason for such delay is probably that they are unable to compile the thing with the newer GCC versions. Ha-ha. Good luck, Microchip.

Comments

2015-09-15 The speed of software halves every 18 months

“Wirth's law is a computing adage which states that software is getting slower more rapidly than hardware becomes faster.”

See Wirth's law on Wikipedia

Just open your eyes and make your code less shitty. Maybe these 5 software frameworks that you smashed into your hello world project is a little bit too much?

Comments

2015-05-26 University in the Butt

In one of my previous posts (2014-09-27 Sand in the Butt) I mentioned my urge to do at least one commit every day. This lasted for quite some time, until the lack of resources actually made me skip one day. And then another one. And then a whole week… Well, take a look yourself:

File:2015-05-26-222442 737x292 scrot.png

I am not sure if I liked this experience of committing something every day. Yes, I was very productive during this period, but let's see if anything changes once I stop following this rule.

Somehow I feel that the current education system does more harm than good. I have not checked my sleep graph yet, but I will not be surprised if it was the worst time during the last two years.

Comments

2015-04-28 Penguins

Do hard work by marking as many of these cute penguins as you can.

http://www.penguinwatch.org/

Comments

2014-04-25 Eclipse and Dark GTK Theme

If you are a happy user of a dark GTK theme, then you are probably familiar with this:
Are you happy now?
That's how it looks like with Boje-Greyscale theme, I am sure that it is pretty bad on other themes as well.

Here is the process I use:

  • Install this: https://raw.github.com/guari/eclipse-ui-theme/master/com.github.eclipseuitheme.themes.updatesite (Help/Install New Software)
  • It will ask you to restart Eclipse. Fine...
  • After restart open Window/Preferences/General/Appearance. Choose !MoonRise theme.
    Still, there are things you cannot unsee...
  • It will tell you that the restart is required, ignore this.
  • It is way better now:
    I still can't read anything
    However, the editor window is still trying to pull your eyeballs out. To fix that we will install this: http://eclipse-color-theme.github.io/update/ (Same process: Help/Install New Software)
  • It will tell you that restart is required. That is true, restart now.
  • Window/Preferences/General/Appearance/Color Theme, choose any theme you like. Sunburst should be OK.
  • Congratulations! You have fixed your eclipse. :)

Some software could be installed from marketplace, but for some reason I am not a fan of it.

Comments