Comments (4)
So when building discount for aarch64 use:
CFLAGS="-g -fPIC" ./configure.sh
from apache-mod-markdown.
Similar problem. The initial error message indicates to recompile libmarkdown with -fPIC.
$ uname -a
Linux no2 5.15.0-1050-raspi #53-Ubuntu SMP PREEMPT Thu Mar 21 10:02:47 UTC 2024 aarch64 aarch64 aarch64 GNU/Linux
$ markdown -V
markdown: discount 2.2.7d
$ git clone https://github.com/hamano/apache-mod-markdown.git
Cloning into 'apache-mod-markdown'...
remote: Enumerating objects: 302, done.
remote: Counting objects: 100% (47/47), done.
remote: Compressing objects: 100% (33/33), done.
remote: Total 302 (delta 25), reused 28 (delta 14), pack-reused 255
Receiving objects: 100% (302/302), 92.49 KiB | 1.54 MiB/s, done.
Resolving deltas: 100% (164/164), done.
$ cd apache-mod-markdown
apache-mod-markdown$ autoreconf -f -i
libtoolize: putting auxiliary files in '.'.
libtoolize: copying file './ltmain.sh'
libtoolize: putting macros in AC_CONFIG_MACRO_DIRS, 'm4'.
libtoolize: copying file 'm4/libtool.m4'
libtoolize: copying file 'm4/ltoptions.m4'
libtoolize: copying file 'm4/ltsugar.m4'
libtoolize: copying file 'm4/ltversion.m4'
libtoolize: copying file 'm4/lt~obsolete.m4'
configure.ac:6: warning: 'AM_CONFIG_HEADER': this macro is obsolete.
configure.ac:6: You should use the 'AC_CONFIG_HEADERS' macro instead.
./lib/autoconf/general.m4:2434: AC_DIAGNOSE is expanded from...
aclocal.m4:745: AM_CONFIG_HEADER is expanded from...
configure.ac:6: the top level
configure.ac:10: warning: The macro `AM_PROG_LIBTOOL' is obsolete.
configure.ac:10: You should run autoupdate.
m4/libtool.m4:100: AM_PROG_LIBTOOL is expanded from...
configure.ac:10: the top level
configure.ac:38: warning: AC_OUTPUT should be used without arguments.
configure.ac:38: You should run autoupdate.
configure.ac:9: installing './compile'
configure.ac:5: installing './missing'
apache-mod-markdown$ ./configure --with-apxs=/usr/bin/apxs --with-discount=/usr/local
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a race-free mkdir -p... /usr/bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether the compiler supports GNU C... yes
checking whether gcc accepts -g... yes
checking for gcc option to enable C11 features... none needed
checking whether gcc understands -c and -o together... yes
checking whether make supports the include directive... yes (GNU style)
checking dependency style of gcc... none
checking build system type... aarch64-unknown-linux-gnu
checking host system type... aarch64-unknown-linux-gnu
checking how to print strings... printf
checking for a sed that does not truncate output... /usr/bin/sed
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for fgrep... /usr/bin/grep -F
checking for ld used by gcc... /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... yes
checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm -B
checking the name lister (/usr/bin/nm -B) interface... BSD nm
checking whether ln -s works... yes
checking the maximum length of command line arguments... 1572864
checking how to convert aarch64-unknown-linux-gnu file names to aarch64-unknown-linux-gnu format... func_convert_file_noop
checking how to convert aarch64-unknown-linux-gnu file names to toolchain format... func_convert_file_noop
checking for /usr/bin/ld option to reload object files... -r
checking for objdump... objdump
checking how to recognize dependent libraries... pass_all
checking for dlltool... no
checking how to associate runtime and link libraries... printf %s\n
checking for ar... ar
checking for archiver @FILE support... @
checking for strip... strip
checking for ranlib... ranlib
checking command to parse /usr/bin/nm -B output from gcc object... ok
checking for sysroot... no
checking for a working dd... /usr/bin/dd
checking how to truncate binary pipes... /usr/bin/dd bs=4096 count=1
checking for mt... mt
checking if mt is a manifest tool... no
checking for stdio.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for strings.h... yes
checking for sys/stat.h... yes
checking for sys/types.h... yes
checking for unistd.h... yes
checking for dlfcn.h... yes
checking for objdir... .libs
checking if gcc supports -fno-rtti -fno-exceptions... no
checking for gcc option to produce PIC... -fPIC -DPIC
checking if gcc PIC flag -fPIC -DPIC works... yes
checking if gcc static flag -static works... yes
checking if gcc supports -c -o file.o... yes
checking if gcc supports -c -o file.o... (cached) yes
checking whether the gcc linker (/usr/bin/ld) supports shared libraries... yes
checking whether -lc should be explicitly linked in... no
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... yes
checking whether C compiler accepts -Wall... yes
checking for apxs tool... APXS found!
checking for discount directory... DISCOUNT found!
checking that generated files are newer than configure... done
configure: creating ./config.status
config.status: creating Makefile
config.status: creating config.h
config.status: executing depfiles commands
config.status: executing libtool commands
apache-mod-markdown$ make
/usr/bin/apxs -c -I/usr/local/include -L/usr/local/lib -lmarkdown mod_markdown.c
/usr/share/apr-1.0/build/libtool --mode=compile --tag=disable-static aarch64-linux-gnu-gcc -prefer-pic -pipe -g -O2 -flto=auto -ffat-lto-objects -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -DLINUX -D_REENTRANT -D_GNU_SOURCE -I/usr/include/apache2 -I/usr/include/apr-1.0 -I/usr/include/apr-1.0 -I/usr/include -I/usr/local/include -c -o mod_markdown.lo mod_markdown.c && touch mod_markdown.slo
libtool: compile: aarch64-linux-gnu-gcc -pipe -g -O2 -flto=auto -ffat-lto-objects -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -DLINUX -D_REENTRANT -D_GNU_SOURCE -I/usr/include/apache2 -I/usr/include/apr-1.0 -I/usr/include/apr-1.0 -I/usr/include -I/usr/local/include -c mod_markdown.c -fPIC -DPIC -o .libs/mod_markdown.o
/usr/share/apr-1.0/build/libtool --mode=link --tag=disable-static aarch64-linux-gnu-gcc -Wl,--as-needed -Wl,-Bsymbolic-functions -flto=auto -ffat-lto-objects -Wl,-z,relro -Wl,-z,now -o mod_markdown.la -L/usr/local/lib -lmarkdown -rpath /usr/lib/apache2/modules -module -avoid-version mod_markdown.lo
libtool: link: aarch64-linux-gnu-gcc -shared -fPIC -DPIC .libs/mod_markdown.o -L/usr/local/lib -lmarkdown -Wl,--as-needed -Wl,-Bsymbolic-functions -flto=auto -Wl,-z -Wl,relro -Wl,-z -Wl,now -Wl,-soname -Wl,mod_markdown.so -o .libs/mod_markdown.so
/usr/bin/ld: /usr/local/lib/libmarkdown.a(tags.o): relocation R_AARCH64_ADR_PREL_PG_HI21 against symbol `extratags' which may bind externally can not be used when making a shared object; recompile with -fPIC
/usr/local/lib/libmarkdown.a(tags.o): in function `mkd_define_tag':
/home/jjp/tmp/discount-2.2.7d/tags.c:32:(.text+0x34): dangerous relocation: unsupported relocation
/usr/bin/ld: /usr/local/lib/libmarkdown.a(tags.o): relocation R_AARCH64_ADR_PREL_PG_HI21 against symbol `extratags' which may bind externally can not be used when making a shared object; recompile with -fPIC
/home/jjp/tmp/discount-2.2.7d/tags.c:33:(.text+0x48): dangerous relocation: unsupported relocation
/usr/bin/ld: /usr/local/lib/libmarkdown.a(tags.o): relocation R_AARCH64_ADR_PREL_PG_HI21 against symbol `extratags' which may bind externally can not be used when making a shared object; recompile with -fPIC
/home/jjp/tmp/discount-2.2.7d/tags.c:33:(.text+0x54): dangerous relocation: unsupported relocation
/usr/bin/ld: /usr/local/lib/libmarkdown.a(tags.o): relocation R_AARCH64_ADR_PREL_PG_HI21 against symbol `extratags' which may bind externally can not be used when making a shared object; recompile with -fPIC
/home/jjp/tmp/discount-2.2.7d/tags.c:33:(.text+0x60): dangerous relocation: unsupported relocation
/usr/bin/ld: /usr/local/lib/libmarkdown.a(tags.o): relocation R_AARCH64_ADR_PREL_PG_HI21 against symbol `extratags' which may bind externally can not be used when making a shared object; recompile with -fPIC
/home/jjp/tmp/discount-2.2.7d/tags.c:33:(.text+0x6c): dangerous relocation: unsupported relocation
/usr/bin/ld: /usr/local/lib/libmarkdown.a(tags.o): relocation R_AARCH64_ADR_PREL_PG_HI21 against symbol `extratags' which may bind externally can not be used when making a shared object; recompile with -fPIC
/home/jjp/tmp/discount-2.2.7d/tags.c:34:(.text+0x78): dangerous relocation: unsupported relocation
/usr/bin/ld: /usr/local/lib/libmarkdown.a(tags.o): relocation R_AARCH64_ADR_PREL_PG_HI21 against symbol `extratags' which may bind externally can not be used when making a shared object; recompile with -fPIC
/home/jjp/tmp/discount-2.2.7d/tags.c:34:(.text+0x84): dangerous relocation: unsupported relocation
/usr/bin/ld: /usr/local/lib/libmarkdown.a(tags.o): relocation R_AARCH64_ADR_PREL_PG_HI21 against symbol `extratags' which may bind externally can not be used when making a shared object; recompile with -fPIC
/home/jjp/tmp/discount-2.2.7d/tags.c:34:(.text+0x98): dangerous relocation: unsupported relocation
/usr/bin/ld: /usr/local/lib/libmarkdown.a(tags.o): relocation R_AARCH64_ADR_PREL_PG_HI21 against symbol `extratags' which may bind externally can not be used when making a shared object; recompile with -fPIC
/home/jjp/tmp/discount-2.2.7d/tags.c:34:(.text+0xa8): dangerous relocation: unsupported relocation
/usr/bin/ld: /usr/local/lib/libmarkdown.a(tags.o): relocation R_AARCH64_ADR_PREL_PG_HI21 against symbol `extratags' which may bind externally can not be used when making a shared object; recompile with -fPIC
/home/jjp/tmp/discount-2.2.7d/tags.c:34:(.text+0xbc): dangerous relocation: unsupported relocation
/usr/bin/ld: /usr/local/lib/libmarkdown.a(tags.o): relocation R_AARCH64_ADR_PREL_PG_HI21 against symbol `extratags' which may bind externally can not be used when making a shared object; recompile with -fPIC
/home/jjp/tmp/discount-2.2.7d/tags.c:34:(.text+0xc8): dangerous relocation: unsupported relocation
/usr/bin/ld: /usr/local/lib/libmarkdown.a(tags.o): relocation R_AARCH64_ADR_PREL_PG_HI21 against symbol `extratags' which may bind externally can not be used when making a shared object; recompile with -fPIC
/home/jjp/tmp/discount-2.2.7d/tags.c:34:(.text+0xd8): dangerous relocation: unsupported relocation
/usr/bin/ld: /usr/local/lib/libmarkdown.a(tags.o): relocation R_AARCH64_ADR_PREL_PG_HI21 against symbol `extratags' which may bind externally can not be used when making a shared object; recompile with -fPIC
/home/jjp/tmp/discount-2.2.7d/tags.c:34:(.text+0xe4): dangerous relocation: unsupported relocation
/usr/bin/ld: /usr/local/lib/libmarkdown.a(tags.o): relocation R_AARCH64_ADR_PREL_PG_HI21 against symbol `extratags' which may bind externally can not be used when making a shared object; recompile with -fPIC
/home/jjp/tmp/discount-2.2.7d/tags.c:34:(.text+0x10c): dangerous relocation: unsupported relocation
/usr/bin/ld: /usr/local/lib/libmarkdown.a(tags.o): relocation R_AARCH64_ADR_PREL_PG_HI21 against symbol `extratags' which may bind externally can not be used when making a shared object; recompile with -fPIC
/home/jjp/tmp/discount-2.2.7d/tags.c:34:(.text+0x11c): dangerous relocation: unsupported relocation
/usr/bin/ld: /usr/local/lib/libmarkdown.a(tags.o): relocation R_AARCH64_ADR_PREL_PG_HI21 against symbol `extratags' which may bind externally can not be used when making a shared object; recompile with -fPIC
/home/jjp/tmp/discount-2.2.7d/tags.c:34:(.text+0x128): dangerous relocation: unsupported relocation
/usr/bin/ld: /usr/local/lib/libmarkdown.a(tags.o): relocation R_AARCH64_ADR_PREL_PG_HI21 against symbol `extratags' which may bind externally can not be used when making a shared object; recompile with -fPIC
/home/jjp/tmp/discount-2.2.7d/tags.c:34:(.text+0x144): dangerous relocation: unsupported relocation
/usr/bin/ld: /usr/local/lib/libmarkdown.a(tags.o): relocation R_AARCH64_ADR_PREL_PG_HI21 against symbol `extratags' which may bind externally can not be used when making a shared object; recompile with -fPIC
/home/jjp/tmp/discount-2.2.7d/tags.c:34:(.text+0x150): dangerous relocation: unsupported relocation
/usr/bin/ld: /usr/local/lib/libmarkdown.a(tags.o): relocation R_AARCH64_ADR_PREL_PG_HI21 against symbol `extratags' which may bind externally can not be used when making a shared object; recompile with -fPIC
/home/jjp/tmp/discount-2.2.7d/tags.c:34:(.text+0x15c): dangerous relocation: unsupported relocation
/usr/bin/ld: /usr/local/lib/libmarkdown.a(tags.o): relocation R_AARCH64_ADR_PREL_PG_HI21 against symbol `extratags' which may bind externally can not be used when making a shared object; recompile with -fPIC
/home/jjp/tmp/discount-2.2.7d/tags.c:34:(.text+0x16c): dangerous relocation: unsupported relocation
/usr/bin/ld: /usr/local/lib/libmarkdown.a(tags.o): relocation R_AARCH64_ADR_PREL_PG_HI21 against symbol `extratags' which may bind externally can not be used when making a shared object; recompile with -fPIC
/usr/local/lib/libmarkdown.a(tags.o): in function `mkd_sort_tags':
/home/jjp/tmp/discount-2.2.7d/tags.c:64:(.text+0x238): dangerous relocation: unsupported relocation
/usr/bin/ld: /usr/local/lib/libmarkdown.a(tags.o): relocation R_AARCH64_ADR_PREL_PG_HI21 against symbol `extratags' which may bind externally can not be used when making a shared object; recompile with -fPIC
/home/jjp/tmp/discount-2.2.7d/tags.c:64:(.text+0x244): dangerous relocation: unsupported relocation
/usr/bin/ld: /usr/local/lib/libmarkdown.a(tags.o): relocation R_AARCH64_ADR_PREL_PG_HI21 against symbol `extratags' which may bind externally can not be used when making a shared object; recompile with -fPIC
/usr/local/lib/libmarkdown.a(tags.o): in function `mkd_search_tags':
/home/jjp/tmp/discount-2.2.7d/tags.c:82:(.text+0x2e4): dangerous relocation: unsupported relocation
/usr/bin/ld: /usr/local/lib/libmarkdown.a(tags.o): relocation R_AARCH64_ADR_PREL_PG_HI21 against symbol `extratags' which may bind externally can not be used when making a shared object; recompile with -fPIC
/home/jjp/tmp/discount-2.2.7d/tags.c:83:(.text+0x2f8): dangerous relocation: unsupported relocation
/usr/bin/ld: /usr/local/lib/libmarkdown.a(tags.o): relocation R_AARCH64_ADR_PREL_PG_HI21 against symbol `extratags' which may bind externally can not be used when making a shared object; recompile with -fPIC
/home/jjp/tmp/discount-2.2.7d/tags.c:83:(.text+0x304): dangerous relocation: unsupported relocation
/usr/bin/ld: /usr/local/lib/libmarkdown.a(tags.o): relocation R_AARCH64_ADR_PREL_PG_HI21 against symbol `extratags' which may bind externally can not be used when making a shared object; recompile with -fPIC
/usr/local/lib/libmarkdown.a(tags.o): in function `mkd_deallocate_tags':
/home/jjp/tmp/discount-2.2.7d/tags.c:94:(.text+0x36c): dangerous relocation: unsupported relocation
/usr/bin/ld: /usr/local/lib/libmarkdown.a(tags.o): relocation R_AARCH64_ADR_PREL_PG_HI21 against symbol `extratags' which may bind externally can not be used when making a shared object; recompile with -fPIC
/home/jjp/tmp/discount-2.2.7d/tags.c:95:(.text+0x380): dangerous relocation: unsupported relocation
/usr/bin/ld: /usr/local/lib/libmarkdown.a(tags.o): relocation R_AARCH64_ADR_PREL_PG_HI21 against symbol `extratags' which may bind externally can not be used when making a shared object; recompile with -fPIC
/home/jjp/tmp/discount-2.2.7d/tags.c:95:(.text+0x394): dangerous relocation: unsupported relocation
/usr/bin/ld: /usr/local/lib/libmarkdown.a(tags.o): relocation R_AARCH64_ADR_PREL_PG_HI21 against symbol `extratags' which may bind externally can not be used when making a shared object; recompile with -fPIC
/home/jjp/tmp/discount-2.2.7d/tags.c:95:(.text+0x3a4): dangerous relocation: unsupported relocation
/usr/bin/ld: /usr/local/lib/libmarkdown.a(tags.o): relocation R_AARCH64_ADR_PREL_PG_HI21 against symbol `extratags' which may bind externally can not be used when making a shared object; recompile with -fPIC
/home/jjp/tmp/discount-2.2.7d/tags.c:95:(.text+0x3b0): dangerous relocation: unsupported relocation
/usr/bin/ld: /usr/local/lib/libmarkdown.a(tags.o): relocation R_AARCH64_ADR_PREL_PG_HI21 against symbol `extratags' which may bind externally can not be used when making a shared object; recompile with -fPIC
/home/jjp/tmp/discount-2.2.7d/tags.c:95:(.text+0x3bc): dangerous relocation: unsupported relocation
/usr/bin/ld: /usr/local/lib/libmarkdown.a(tags.o): relocation R_AARCH64_ADR_PREL_PG_HI21 against symbol `extratags' which may bind externally can not be used when making a shared object; recompile with -fPIC
/home/jjp/tmp/discount-2.2.7d/tags.c:95:(.text+0x3cc): dangerous relocation: unsupported relocation
collect2: error: ld returned 1 exit status
apxs:Error: Command failed with rc=65536
.
make: *** [Makefile:708: mod_markdown.la] Error 1
from apache-mod-markdown.
In my case the solution was to add -fPIC to CFLAGS in the discount Makefile before building.
from apache-mod-markdown.
The -fPIC flag generates Position Independent Code suitable for use in a shared library.
from apache-mod-markdown.
Related Issues (20)
- Brew support? HOT 2
- make install does not work in Ubuntu HOT 3
- Some unusual differences between master(7b0eb) and v1.0.3 HOT 2
- 1st level header doesn't translated as <title> HOT 2
- Feature Request: Allow customize Doctype HOT 2
- Content-Type should be application/xhtml+xml when Doctype is XHTML
- <title> element is required even when no title is available HOT 1
- Feature Request: Support LaTeX(MathJax) rendering HOT 1
- checklists are not rendered nicely HOT 1
- Single tick ` and triple tick ``` both render as <code> HOT 2
- Build instructions broken HOT 1
- Hash within Code section HOT 2
- How to use MarkdownFooterHtml/MarkdownHeaderHtml HOT 26
- Generate a Table of Contents
- Serving compressed markdown file
- Cannot build on Debian 10 HOT 1
- configure.ac: obsoleted m4s macros
- does nothing
- Unable to build, Ubuntu 15.04 HOT 7
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from apache-mod-markdown.