After switching to multi-user mode, logging in on tty, blacklisting nouveau driver, running mkinitrd, rebooting I ran nvidia installer script (NVIDIA-xxxx.sh) which failed with the errors I described. I double checked that when running Nvidia installer nouveau driver was not loaded (lsmod | grep nouveau).
I used to install the driver manually many times. I also have openSUSE 13.2 installation, that worked with nvidia driver manually installed for several years.
As I said, having “-fstack-protector not supported by compiler” error is weird, because it was supported for a very long time already, probably since gcc-4.7 …
I also noticed that although rpm reports that gcc5-5.3.1+r233831-1.2.x86_64 is installed, I get slightly different revision version from running “gcc --version”:
Hi, I had no problems with TW and NVIDIA-Linux-x86_64-364.15.run so it seems due to your config…
I think you need kernel-default-devel and kernel-macros, check “make” too.
kernel-source must be prepared and configured to build kernel modules, it cannot be used as installed.
I’m no expert on the topic, but the above are the outstanding differences in my configuration.
kernel-default-devel and kernel-macros were installed. Sorry that I forgot to list them among installed ones. “make” is also installed. I also ran “make clean” and “make mrproper” in kernel source tree (in /usr/src/linux-4.5.0-3). Just in case, I also copied /boot/config-4.5.0-3-default to /usr/src/linux-4.5.0-3/.config .
But it all did not help to fix the problem :-/
In opensuse 13.2 there was no need to do anything with kernel source tree. The nvidia installer just ran successfully. I wonder if the source installed corresponds to the kernel installed. And if not could it be a problem. At least in case of gcc there is a minor discrepancy: “rpm -q gcc5” and “gcc --version” show different revision numbers.
Finally got to the bottom of this problem. The offending package that changed compiler settings was gcc-PIE. After removing it Nvidia kernel driver/moduled compiled smoothly and after rebooting got graphical login screen and nvidia module is loaded.
A few comments about building external kernel modules against an openSUSE-Kernel and trying to correct some false assumptions made in this thread:
The package “kernel-source” is not needed for this and hasn’t been for years.
If you want to build an externel (sic!) kernel module for a kernel obtained from an openSUSE-RPM (built with their standard procedure) you will need
kernel-devel (architecture/flavor independent files, mostly headers, Kconfigs and Makefiles)
kernel-$FLAVOR-devel (with $FLAVOR = flavor of target kernel, i.e default or pae, or …which contains the target specific headers and configuration files already configured)
and of course
the standard build tools (make, gcc, binutils …)
and that’s it.
Nowadays (= since kernel-devel has been split off that package), “kernel-source” only contains the sources not needed to build external modules, if you don’t want to modify and the rebuild the whole kernel (based on the standard openSUSE configuration), you will never need “kernel-source”.
As said before, the respective kernel-$FLAVOR-devel package contains the actual configuration for the target kernel.
This means that running “make mrproper” or “make config” is not needed, as it already has been done when the kernel was built and the results of that process are the contents of kernel-$FLAVOR-devel.
This might even break things if it replaces/changes those configuration files in an incompatible way (although I have no idea if it really does, maybe in a best case scenario it is only a waste of time and does not change anything.)
The packages “kernel-syms” and “kernel-macros” are only needed if one wants to build “kmp” packages, as they contain specific files for building those RPMs (kernel-macros) or pull in kernel-$FLAVOR-devel packages as a dependency. In OBS, you maybe want to build/distribute packages for more than one kernel flavor, so kernel-syms is only a dummy to take care of that (in “ye olden days” kernel-syms really contained kernel module symbols, but this also has been changed years ago, check yourself what is inside kernel-syms now).
In a nutshell:
If you have kernel-default-1.2.3 and want to build an external kernel modulefor that kernel you only need “kernel-devel-1.2.3” and “kernel-default-devel-1.2.3” as kernel specific packages.
Any manual change of kernel configuration (make clean, make mrproper, make config, etc.) is not needed and potentially breaks things instead of doing any good (in a best case scenario it does not anything and is only a waste of time).