Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[zlib] Link time permission denied despite all applied fixes #430

Closed
Brute2 opened this issue Jan 19, 2015 · 1 comment
Closed

[zlib] Link time permission denied despite all applied fixes #430

Brute2 opened this issue Jan 19, 2015 · 1 comment

Comments

@Brute2
Copy link

Brute2 commented Jan 19, 2015

hi, before posting here I followed several suggestions on stackoverflow and other sites to "fix" this problem and since none of them work for me I seek your help...

I'm compiling zlib 1.2.8-5 package against the script from this repo with MSYS2 and gcc 4.9.2 on x64 machine...

Here is my output:

Admin@laptop MINGW64 /GitHub/MINGW-packages/mingw-w64-zlib
$ makepkg-mingw
==> Making package: mingw-w64-x86_64-zlib 1.2.8-5 (Mon, Jan 19, 2015  2:46:01 AM                                                                                                                )
==> Checking runtime dependencies...
==> Checking buildtime dependencies...
==> Retrieving sources...
  -> Found zlib-1.2.8.tar.gz
  -> Updating minizip git repo...
Fetching origin
  -> Found 01-zlib-1.2.7-1-buildsys.mingw.patch
  -> Found 02-no-undefined.mingw.patch
  -> Found 03-dont-put-sodir-into-L.mingw.patch
  -> Found 04-wrong-w8-check.mingw.patch
  -> Found 05-fix-a-typo.mingw.patch
  -> Found 010-unzip-add-function-unzOpenBuffer.patch
  -> Found 011-Add-no-undefined-to-link-to-enable-build-shared-vers.patch
  -> Found 012-Add-bzip2-library-to-pkg-config-file.patch
==> Validating source files with md5sums...
    zlib-1.2.8.tar.gz ... Passed
    minizip ... Skipped
    01-zlib-1.2.7-1-buildsys.mingw.patch ... Passed
    02-no-undefined.mingw.patch ... Passed
    03-dont-put-sodir-into-L.mingw.patch ... Passed
    04-wrong-w8-check.mingw.patch ... Passed
    05-fix-a-typo.mingw.patch ... Passed
    010-unzip-add-function-unzOpenBuffer.patch ... Passed
    011-Add-no-undefined-to-link-to-enable-build-shared-vers.patch ... Passed
    012-Add-bzip2-library-to-pkg-config-file.patch ... Passed
==> Extracting sources...
  -> Extracting zlib-1.2.8.tar.gz with /usr/bin/bsdtar
  -> Creating working copy of minizip git repo...
Reset branch 'makepkg'
==> Starting prepare()...
patching file Makefile.in
Hunk #1 succeeded at 34 with fuzz 2.
Hunk #6 succeeded at 237 (offset -17 lines).
patching file configure
Hunk #2 succeeded at 63 (offset -1 lines).
Hunk #3 succeeded at 76 (offset 1 line).
Hunk #4 succeeded at 191 (offset -2 lines).
Hunk #5 succeeded at 329 (offset -2 lines).
Hunk #6 succeeded at 794 (offset 13 lines).
Hunk #7 succeeded at 817 (offset 10 lines).
Hunk #8 succeeded at 848 (offset 10 lines).
patching file zlib.pc.in
Applying: unzip: add function unzOpenBuffer
Applying: Add -no-undefined to link to enable build shared version with mingw.
Applying: Add bzip2 library to pkg-config file.
==> Removing existing $pkgdir/ directory...
==> Starting build()...
Using ar
Checking for x86_64-w64-mingw32-gcc...
Checking for shared library support...
Building shared library with x86_64-w64-mingw32-gcc.
Checking for off64_t... Yes.
Checking for fseeko... Yes.
Checking for strerror... Yes.
Checking for unistd.h... Yes.
Checking for stdarg.h... Yes.
Checking whether to use vs[n]printf() or s[n]printf()... using vs[n]printf().
Checking for vsnprintf() in stdio.h... Yes.
Checking for return value of vsnprintf()... Yes.
Checking for attribute(visibility) support... No.
x86_64-w64-mingw32-gcc -march=x86-64 -mtune=generic -O2 -pipe  -D_LARGEFILE64_SO                                                                                                                URCE=1  -I. -c -o example.o test/example.c
x86_64-w64-mingw32-gcc -march=x86-64 -mtune=generic -O2 -pipe  -D_LARGEFILE64_SO                                                                                                                

URCE=1  -DPIC -c -o objs/gzlib.o gzlib.c
x86_64-w64-mingw32-gcc -march=x86-64 -mtune=generic -O2 -pipe  -D_LARGEFILE64_SO                                                                                                                URCE=1  -DPIC -c -o objs/gzread.o gzread.c
x86_64-w64-mingw32-gcc -march=x86-64 -mtune=generic -O2 -pipe  -D_LARGEFILE64_SO                                                                                                                URCE=1  -DPIC -c -o objs/gzwrite.o gzwrite.c
x86_64-w64-mingw32-gcc -shared -Wl,-export-all -Wl,--enable-auto-image-base -Wl,                                                                                                                --out-implib=libz.dll.a -march=x86-64 -mtune=generic -O2 -pipe  -D_LARGEFILE64_S                                                                                                                OURCE=1 -o zlib1.dll adler32.lo crc32.lo deflate.lo infback.lo inffast.lo inflat                                                                                                                e.lo inftrees.lo trees.lo zutil.lo compress.lo uncompr.lo gzclose.lo gzlib.lo gz                                                                                                                read.lo gzwrite.lo   -L. -pipe
D:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/4.9.2/../../../../x86_64-w64                                                                                                                -mingw32/bin/ld.exe: cannot open output file zlib1.dll: Permission denied
collect2.exe: error: ld returned 1 exit status
Makefile:169: recipe for target 'zlib1.dll' failed
make: *** [zlib1.dll] Error 1
==> ERROR: A failure occurred in build().
    Aborting...

Here are suggested fixes which I applied:

  1. service Application experience started and set to automatic startup (reboot)
  2. run mingw64_shell.bat console as Administrator
  3. set ownership and files permission to full control (entry msys64 directory)

I would also like to add that compiling zlib package from MSYS2-packages repo worked with no problem.

at this point I'm stuck and have no idea what next, please help.
Thanks!

@Brute2
Copy link
Author

Brute2 commented Jan 19, 2015

I apologize for all the junk I wrote here, It was my mistake because all I had to do is type:
makepkg-mingw --help

and then figured out the solution by typing:

makepkg-mingw --cleanbuild 😃

@Alexpux Alexpux closed this as completed Apr 9, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants