Hey there, fellow tech enthusiasts! It's time for another update on my SPO600 Winter Project journey. Stage 2 has been quite a rollercoaster ride, filled with both triumphs and hurdles. Let's dive right in and explore the progress I've made and the challenges I've faced.
Realignment of Tasks: Discovering My Path
A couple of weeks ago, an unexpected twist occurred in our project journey. It turned out that my colleague had been working on the Version List Processing task, which I initially thought was assigned to me. After this realization, we swiftly realigned our tasks, and I found myself redirected to focus on Command-line Parsing instead.
Adding AFMV Capability: A Step Forward
Despite the shift in focus, I quickly immersed myself in the Command-line Parsing task, I did my research mainly on gcc.gnu.org and made significant strides. One of the key milestones I've achieved in Stage 2 is the implementation of AFMV (auto-function-multi-versioning) capability in the GNU Compiler Collection (GCC) for AArch64 systems. This involved significant code modifications and careful integration with existing GCC functionality.
One notable aspect of my implementation is the addition of support for specifying AFMV options via the command-line using the `afmv=` flag. This allows users to enable AFMV and provide a list of architectural feature versions, such as "sve" or "sve2", to be used as additional variants. I ensured robust parsing of these options to validate architectural features and handle error cases gracefully.
This is the option I created in common.opt to get the version list for further processing.
-afmv=
Common Joined Var(flag_afmv) Optimization
Enable automatic function multiversioning with specified architectural features.
Handling Errors and Mac Build Woes
I added some errors in the code as well, like if the user enters no afmv values, then it would display the error, I did this in opts.cc file, and this is the code:
During the implementation phase, I encountered a couple of roadblocks that tested my problem-solving skills. One challenge arose when attempting to build GCC on a macOS environment. I stumbled upon the dreaded error message:
The directory (BUILD_SYSTEM_HEADER_DIR) that should contain system headers does not exist:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/usr/include
(on Darwin this usually means you need to pass the --with-sysroot= flag to point to a valid MacOS SDK)
make[3]: *** [stmp-fixinc] Error 1
To overcome this obstacle, I decided to switch gears and build GCC on an AArch64 server. However, this decision came with its own set of challenges. The server turned out to be extremely slow, significantly slowing down my development process. Moreover, to add to the woes, the server was intermittently down, forcing me to resort to using IP addresses instead of my usual user ID.
Looking Ahead
Despite the hurdles I faced, I'm proud of the progress I've made in Stage 2. The AFMV capability is starting to take shape, paving the way for further enhancements and optimizations. As I move forward, I'll continue to refine my implementation, address any remaining issues, and ensure seamless integration with the GCC codebase.
For stage 3, I uploaded the code to Github, and was also in full contact with my colleagues for any coordination required by them for their part's implementation.
Cheers, Muhammad Wajih