How do I tell obs to use an "as" option

I am trying to support VirtualBox for OpenSUSE.

Every .asm file in the build for Virtualbox release 7.0.x fails complaining with thus error:
:

  872s] /usr/lib64/gcc/x86_64-suse-linux/12/../../../../x86_64-suse-linux/bin/ld: /home/abuild/rpmbuild/BUILD/VirtualBox-7.0.2/out/linux.amd64/release/obj/VBoxDTraceR0/VBoxDTraceR0A.o: relocation R_X86_64_PC32 against symbol `dtrace_probe' can not be used when making a shared object; recompile with -fPIC

How do I tell the osc build to add the -fPIC to the “as” command ( I assume that .asm files are being built with as or does gcc do the compiling ?).

I suspect it goes in this part of the .spec file but what to enter?

# Craft LocalConfig.kmk
echo "
VBOX_GCC_OPT                   := %{optflags}
VBOX_GCC_WERR                  :=
VBOX_BUILD_PUBLISHER           := _SUSE

Then you probably have some project. Providing link to project is always helpful in questions about OBS.

How do I tell the osc build to add the -fPIC to the “as” command

It is entirely up to your application’s build system.

( I assume that .asm files are being built with as or does gcc do the compiling ?).

Again - it is entirely up to your application’s build system. Open Build Service can automate building of your application, but you have to know how to do it. OBS cannot do it for you.

I suspect it goes in this part of the .spec file but what to enter?

Whatever your application’s build system needs. This will probably go into %build section of spec file.

Most build systems (GNU Autoconf, cmake, meson) support some sort of command line options or environment variables to alter build behavior, but it is up to you as maintainer to know what to use. If you know what, but do not know how, then this forum would be the right place. But the question “what to tell VirtualBox to use specific options during build” is simply out of scope for OBS.

I would wait until it is build in the Virtualization Repo…

That is what we are trying to do. The osc build did not have any issues that with 6.1.40 just the new 7.0.X. Some of the 180 .asm files need forced relocatable code -fPIC.

I was hoping that there is a way to add an option within the .asm source code. There was in MASM back in DOS 5 days.

Didn’t noticed that you are the Maintainer of Virtualbox…