sfjro / aufs-standalone

27 stars 14 forks source link

aufs-util fails to compile against aufs.h from 5.15.41 branch #18

Open GIJack opened 2 years ago

GIJack commented 2 years ago

I am using the 5.15.41 branch

I am trying to compile the latest aufs-util from sourceforge:


cc -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions         -Wp,-D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security         -fstack-clash-protection -fcf-protection -fstack-protector -O -Wall -D_GNU_SOURCE -I./libau -DAUFHSM_CMD=\"/usr/bin/aufhsm\" -DMOUNT_CMD=\"/bin/mount\" -DUMOUNT_CMD=\"/bin/umount\" -Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now  ver.c   -o ver
In file included from ver.c:19:
/usr/include/linux/aufs_type.h:301:41: error: expected ‘:’, ‘,’, ‘;’, ‘}’ or ‘__attribute__’ before ‘*’ token
  301 |         struct au_rdu_ent __user        *e;
      |                                         ^
make: *** [<builtin>: ver] Error 1
==> ERROR: A failure occurred in package().
    Aborting...
sfjro commented 2 years ago

GI Jack:

cc -march=3Dx86-64 -mtune=3Dgeneric -O2 -pipe -fno-plt -fexceptions = -Wp,-D_FORTIFY_SOURCE=3D2 -Wformat -Werror=3Dformat-security -= fstack-clash-protection -fcf-protection -fstack-protector -O -Wall -D_GNU= _SOURCE -I./libau -DAUFHSM_CMD=3D\"/usr/bin/aufhsm\" -DMOUNT_CMD=3D\"/bin= /mount\" -DUMOUNT_CMD=3D\"/bin/umount\" -Wl,-O1,--sort-common,--as-needed= ,-z,relro,-z,now ver.c -o ver=0D In file included from ver.c:19:=0D /usr/include/linux/aufs_type.h:301:41: error: expected =E2=80=98:=E2=80=99= , =E2=80=98,=E2=80=99, =E2=80=98;=E2=80=99, =E2=80=98}=E2=80=99 or =E2=80= =98attribute=E2=80=99 before =E2=80=98=E2=80=99 token=0D 301 | struct au_rdu_ent __user e;=0D | ^=0D make: *** [: ver] Error 1=0D

Hmm, on my test system,

$ make CPPFLAGS=-I.../aufs5-linux/usr/include BuildDIRREN=yes BuildFHSM=yes -B all cc -O -Wall -Werror -I.../aufs5-linux/usr/include -D_GNU_SOURCE -I./libau -DAUFHSM_CMD=\"/usr/bin/aufhsm\" -DMOUNT_CMD=\"/bin/mount\" -DUMOUNT_CMD=\"/bin/umount\" -DAUFHSM ver.c -o ver ./ver

No error.

I'm afraid you've forgot specifying CPPFLAGS after running "make headers_install" under aufs5-linux or aufs5-standalone tree.

And if your compiler is musl, then I'd sugest you to specify Glibc=no in your command line. This is not a final solution, since there may exist something to fix in aufs-util. Glibc=no is just a temporary work-around.

J. R. Okajima

sfjro commented 2 years ago

I'm afraid you've forgot specifying CPPFLAGS after running "make headers_install" under aufs5-linux or aufs5-standalone tree.

And if your compiler is musl, then I'd sugest you to specify Glibc=no in your command line. This is not a final solution, since there may exist something to fix in aufs-util. Glibc=no is just a temporary work-around.

As a next step to "mission: make headers_install and Glibc=no", I'd like you to try this patch.

J. R. Okajima

diff --git a/Makefile b/Makefile index 5ca7766..3a040f6 100644 --- a/Makefile +++ b/Makefile @@ -66,9 +66,7 @@ define test_glibc echo no; } |\ tee ${LastTestGlibc}) endef -pre:

GIJack commented 2 years ago

I think I am missing something. What about this build script is wrong:

https://gitlab.com/ninjaos/arch-pkgbuild/-/blob/master/aufs-util/PKGBUILD

sfjro commented 2 years ago

------- Blind-Carbon-Copy

From: "J. R. Okajima" @.> To: @. Subject: aufs5 GIT release (v5.19-rc2) MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: @.> Date: Mon, 20 Jun 2022 00:27:14 +0900 Message-ID: @.>

o minor

J. R. Okajima


------- End of Blind-Carbon-Copy

sfjro commented 1 year ago

I'm afraid you've forgot specifying CPPFLAGS after running "make headers_install" under aufs5-linux or aufs5-standalone tree.

And if your compiler is musl, then I'd sugest you to specify Glibc=no in your command line. This is not a final solution, since there may exist something to fix in aufs-util. Glibc=no is just a temporary work-around.

As a next step to "mission: make headers_install and Glibc=no", I'd like you to try this patch.

J. R. Okajima

diff --git a/Makefile b/Makefile index 5ca7766..3a040f6 100644 --- a/Makefile +++ b/Makefile @@ -66,9 +66,7 @@ define test_glibc echo no; } |\ tee ${LastTestGlibc}) endef -pre: