Browsed by
Author: matt

Kernel compiling and the PIC mode error

Kernel compiling and the PIC mode error

If you see this when compiling an Ubuntu or other kernel (my case was a Yocto kernel on an Ubuntu 17.04 distro)

...
CHK include/generated/uapi/linux/version.h
CHK include/generated/utsrelease.h
CC scripts/mod/empty.o
/usr/src/linux-4.4/scripts/mod/empty.c:1:0: error: code model kernel does not support PIC mode
/* empty file to figure out endianness / word size */

 

Then the issue is with your gcc installation. In gcc 6+ versions, PIE (position independent executables) is enabled by default. So in order to compile you need to disable it. Even gcc 5 has the issue. This is a known bug for gcc. Bug Link.

So far there is no official patch from gcc side, so the workaround is to patch the Makefile of kernel source.

If you are familiar with patching the source file use the codes from this link to create the patch file then try to compile.Patch File

Here’s the patch to add to your kernel Makefile to disable PIE compiling.

diff –git a/Makefile b/Makefile
index 5c18baa..e342473 100644
— a/Makefile
+++ b/Makefile
@@ -612,6 +612,12 @@ endif # $(dot-config)
# Defaults to vmlinux, but the arch makefile usually adds further targets
all: vmlinux

+# force no-pie for distro compilers that enable pie by default
+KBUILD_CFLAGS += $(call cc-option, -fno-pie)
+KBUILD_CFLAGS += $(call cc-option, -no-pie)
+KBUILD_AFLAGS += $(call cc-option, -fno-pie)
+KBUILD_CPPFLAGS += $(call cc-option, -fno-pie)

# The arch Makefile can set ARCH_{CPP,A,C}FLAGS to override the default
# values of the respective KBUILD_* variables
ARCH_CPPFLAGS :=

 

Hearing for the first time…

Hearing for the first time…

We are far greater than the limitations of our bodies. It’s moments like this that show our transcendent natures…

Christy Keane’s daughter Charly was born deaf. She’s still an infant, but recently got hearing aids. We’ve seen older children and adults get emotional when they hear sound for the first time, but Charly is so young, she doesn’t understand what’s happening or how to react. Her facial expressions are precious.

Compare these reactions of Charly and a 29 year old:

With this:

Robotic Magic

Robotic Magic

The double pendulum problem is kind of a historical/mathematical marvel. It is very easy to predict the motion of a common, everyday clock pendulum that swings back and forth; but add another pendulum at the end of that, and the complexity shoots through the roof in the most unexpected ways. It puzzled early mathematicians for years.

The system begins to exhibit chaotic motion, and the mathematics needed to solve the motion goes from simple polynomial math to Lagrange differential equations requiring a full college program of Calculus to solve. Here’s a full solution write-up.

Solving is one problem, but making something useful out of it is even more impressive. Here are two robots that can balance not only a double pendulum, but a triple! One application would be to have self-parking and skid-controllable multi-trailer semis. There are probably many more.

If the original double-pendulum mathematicians could see this, they would consider is sorcery. If you’ve ever tried to balance a broom on your hand, you should also marvel:

Triple pendulum:

Cable robots

Cable robots

Cable robots are capable of some extremely fast and ultra-precise movements. They also scale to large sizes better than articulated ones. Check out the extremely fast and precise movement of this system:

Or large scale capable of carrying a human:

They also can be used for haptic feedback systems:

Experimental ball pit

Experimental ball pit

Elements, an experimental art film by Maxim Zhestkov, follows more than two billion black and white spheres through a series of experiments within several enclosed spaces.

3D printed food masterpieces

3D printed food masterpieces

Ukrainian chef Dinara Kasko pairs baking and 3D printing to craft incredibly sculpted pastries that would look more at home at an art gallery than a dinner table. She works with mathematicians and sculptors to create algorithms that blend cooking and designing. Take a tasty tour of these desserts that are a treat for all the senses.