Translate

Archives

Installing And Configuring UDK2018/Clang 7.0 On Fedora 29

This post shows you how to install the UDK2018 snapshot of EDK2 on Fedora 29 and build 64-bit UEFI applications using the Clang 7.0 toolchain.

Installing and Configuring UDK2017 on Fedora 26

In this post, I show you how to install and configure UDK2017 on Fedora 26. I also show you how to build a simple HelloWorld UEFI application using the installed UDK2017 tools and environment.

The ccache Utility

There’s a very useful tool for gcc and similar compilers called ccache which many people may not be aware is installed on their system. It is a compiler cache. Supported languages include C, C++, Objective-C and Objective-C++. The idea behind ccache is to speed up code recompilation by caching the result of previous compilations and detecting when the same compilation is being done again. While it may take a few seconds longer to compile a program the first time you use ccache, subsequent compiles will typically be much faster. Here is what my ccache cache statistics look like after a

Sprintf Portability and Leading Zeros

On some platforms, code such as the following can be used to output a string with leading zeros left padded to a length of 4. sprintf(*str, “%04s”, *pstr); This works on AIX for example. However if the same code is compiled on Linux using gcc, it outputs leading spaces, padded to a length of 4, instead of leading zeros. There is no simple way to fix this behavior. This particular usage of leading zero padding with the string format is explicitly undefined in the various C standards. What is outputted depends on a platform’s libraries rather than the compiler. As

Dump GCC Preprocessor Defines

Here are three ways to dump the preprocessor defines in GCC. $ gcc -dM -E – < /dev/null $ gcc -E -dM -x c /dev/null $ touch foo.h; cpp -dM foo.h For gcc version 4.6.0 on 64-bit Fedora 15 these preprocessor defines are: #define __DBL_MIN_EXP__ (-1021) #define __UINT_LEAST16_MAX__ 65535 #define __FLT_MIN__ 1.17549435082228750797e-38F #define __UINT_LEAST8_TYPE__ unsigned char #define __INTMAX_C(c) c ## L #define __CHAR_BIT__ 8 #define __UINT8_MAX__ 255 #define __WINT_MAX__ 4294967295U #define __ORDER_LITTLE_ENDIAN__ 1234 #define __SIZE_MAX__ 18446744073709551615UL #define __WCHAR_MAX__ 2147483647 #define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_1 1 #define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_2 1 #define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4 1 #define __DBL_DENORM_MIN__ ((double)4.94065645841246544177e-324L) #define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_8 1 #define __FLT_EVAL_METHOD__ 0 #define __unix__ 1