{
    "mode": "man",
    "parameter": "perlsynology",
    "section": "1",
    "url": "https://www.chedong.com/phpMan.php/man/perlsynology/1/json",
    "generated": "2026-11-21T12:16:33Z",
    "sections": {
        "NAME": {
            "content": "perlsynology - Perl 5 on Synology DSM systems\n",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "Synology manufactures a vast number of Network Attached Storage (NAS) devices that are very\npopular in large organisations as well as small businesses and homes.\n\nThe NAS systems are equipped with Synology Disk Storage Manager (DSM), which is a trimmed-\ndown Linux system enhanced with several tools for managing the NAS. There are several\nflavours of hardware: Marvell Armada (ARMv5tel, ARMv7l), Intel Atom (i686, x8664), Freescale\nQorIQ (PPC), and more. For a full list see the Synology FAQ <https://kb.synology.com/en-\nglobal/DSM/tutorial/WhatkindofCPUdoesmyNAShave>.\n\nSince it is based on Linux, the NAS can run many popular Linux software packages, including\nPerl. In fact, Synology provides a ready-to-install package for Perl, depending on the\nversion of DSM the installed perl ranges from 5.8.6 on DSM-4.3 to 5.28.1 on DSM-7.1.\n\nThere is an active user community that provides many software packages for the Synology DSM\nsystems; at the time of writing this document they provide Perl version 5.28.1.\n\nThis document describes various features of Synology DSM operating system that will affect\nhow Perl 5 (hereafter just Perl) is configured, compiled and/or runs. It has been compiled\nand verified by Johan Vromans for the Synology DS413 (QorIQ), with feedback from H.Merijn\nBrand (DS213: ARMv5tel, RS815: Intel Atom x64, and DS218+: Celeron J3355).\n",
            "subsections": [
                {
                    "name": "Setting up the build environment",
                    "content": "DSM 7\n\nFor a comfortable development environment, Entware is currently the only viable solution.\nJust follow the detailed instructions on Install Entware on Synology NAS\n<https://github.com/Entware/Entware/wiki/Install-on-Synology-NAS>.  supported architectures\nare armv5, armv7, mipsel, wl500g, x8632, and x8664.  Check here\n<https://pkg.entware.net/binaries/> for supported platforms.\n\nThat github link also shows what environments should be supported.\n\nIt was tested on DSM-7.1 by H.Merijn Brand on a DS218+ and a DS220+ (both Intel x64).\n\nEntware comes with a precompiled 5.26.1 (Jan 2018) that allowes building shared XS code. Note\nthat this installation does not use a siteperl folder. The available \"cpan\" works. If all\nrequired development packages are installed too, also for XS.\n\nInstalling perl from the Community package center:\n\n•   Using your favourite browser open the DSM management page and start the Package Center.\n\n•   In Settings, add the following Package Sources:\n\nName:     Community\nLocation: https://synopackage.com/repository/spk/All\n\n•   Still in Settings, in Channel Update, select Beta Channel.\n\nTo complete the development environment, install make and gcc\n\nds220# opkg install make gcc\n\nThen, optionally, make sure you use the more recent bash and gawk.\n\nds220# opkg install bash gawk\nds220# cd /usr/bin\nds220# mv bash bash.syno\nds220# ln -s /opt/bin/bash .\n\nIn order to have Configure find the required libraries\n\nds220# cd /opt/lib\nds220# ln -s libcrypt.so.?       libcrypt.so\nds220# ln -s libdl.so.?          libdl.so\nds220# ln -s libgdbm.so.?        libgdbm.so\nds220# ln -s libgdbmcompat.so.? libgdbmcompat.so\nds220# ln -s libm.so.?           libm.so\nds220# ln -s libpthread.so.?     libpthread.so\nds220# ln -s libutil.so.?        libutil.so\n\nDSM 6\n\nUsing  iPkg  has  been  deprecated  on  DSM  6,  but  an  alternative is available for DSM 6:\nentware/opkg. For instructions on how to use that, please read Install Entware-ng on Synology\nNAS <https://github.com/Entware-ng/Entware-ng/wiki/Install-on-Synology-NAS>\n\nThat sadly  does  not  (yet)  work  on  QorIQ.  At  the  moment  of  writing,  the  supported\narchitectures   are   armv5,   armv7,   mipsel,  wl500g,  x8632,  and  x8664.   Check  here\n<https://pkg.entware.net/binaries/> for supported platforms.\n\nEntware-ng comes with a precompiled 5.24.1 (June 2017) that allowes building shared XS  code.\nNote  that  this installation does not use a siteperl folder. The available \"cpan\" works. If\nall required development packages are installed too, also for XS.\n\nDSM 5\n\nAs DSM is a trimmed-down Linux system, it lacks many of  the  tools  and  libraries  commonly\nfound  on  Linux.  The  basic  tools  like  sh,  cp,  rm,  etc. are implemented using BusyBox\n<https://en.wikipedia.org/wiki/BusyBox>.\n\n•   Using your favourite browser open the DSM management page and start the Package Center.\n\n•   If you want to smoke test Perl, install \"Perl\".\n\n•   In Settings, add the following Package Sources:\n\nhttps://www.cphub.net\nhttp://packages.quadrat4.de\n\nAs these two are both discontinued, it is unlikely you will be able to  set  up  a  build\nenvironment on DSM 5.\n\n•   Still in Settings, in Channel Update, select Beta Channel.\n\n•   Press  Refresh.  In  the  left  panel the item \"Community\" will appear.  Click it. Select\n\"Bootstrap Installer Beta\" and install it.\n\n•   Likewise, install \"iPKGui Beta\".\n\nThe application window should now show an icon for iPKGui.\n\n•   Start iPKGui. Install the packages \"make\", \"gcc\" and \"coreutils\".\n\nIf you want to smoke test Perl, install \"patch\".\n\nThe next step is to add some symlinks to  system  libraries.  For  example,  the  development\nsoftware  expect a library \"libm.so\" that normally is a symlink to \"libm.so.6\". Synology only\nprovides the latter and not the symlink.\n\nHere the actual architecture of the Synology system matters. You have to find out  where  the\ngcc  libraries  have  been installed. Look in /opt for a directory similar to arm-none-linux-\ngnueab or powerpc-linux-gnuspe. In the instructions below I'll use powerpc-linux-gnuspe as an\nexample.\n\n•   On the DSM management page start the Control Panel.\n\n•   Click Terminal, and enable SSH service.\n\n•   Close Terminal and the Control Panel.\n\n•   Open a shell on the Synology using ssh and become root.\n\n•   Execute the following commands:\n\ncd /lib\nln -s libm.so.6 libm.so\nln -s libcrypt.so.1 libcrypt.so\nln -s libdl.so.2 libdl.so\ncd /opt/powerpc-linux-gnuspe/lib  (or\n/opt/arm-none-linux-gnueabi/lib)\nln -s /lib/libdl.so.2 libdl.so\n\nWARNING: When you perform a system software upgrade, these links will disappear and  need  to\nbe re-established.\n"
                },
                {
                    "name": "Compiling Perl 5",
                    "content": "When the build environment has been set up, building and testing Perl is straightforward. The\nonly  thing  you  need  to  do  is download the sources as usual, and add a file Policy.sh as\nfollows:\n\n# Administrivia.\nperladmin=\"your.email@goes.here\"\n\n# Install Perl in a tree in /opt/perl instead of /opt/bin.\nprefix=/opt/perl\n\n# Select the compiler. Note that there is no 'cc' alias or link\n# on older DSM versions\ncc=gcc\nawk=/opt/bin/gawk\n\n# Build flags. Optional\nccflags=\"-DDEBUGGING\"\n\n# Library and include paths.\nlocincpth=\"/opt/include\"\nloclibpth=\"/opt/lib /usr/local/lib /usr/lib\"\nlibpth=\"/opt/lib /usr/local/lib /usr/lib\"\n\nYou may want to create the destination directory and give it  the  right  permissions  before\ninstalling, thus eliminating the need to build Perl as a super user.\n\nIn the directory where you unpacked the sources, issue the familiar commands:\n\n$ bash ./Configure -Dusedevel -Duseshrplib -Duse64bitall -des\n$ make -j2\n$ env TESTJOBS=2 make testharness\n$ make install\n"
                },
                {
                    "name": "Known problems",
                    "content": "Configure\n\nThe  GNU  C-compiler  might  spit out unexpected stuff under -v, which causes the analysis of\ncppsymbols to fail because of unmatched quotes.\n\nYou'll note if config.sh fails with a syntax error.\n\nBuild\n\nError message \"No error definitions found\".\nThis error is generated when it is not possible to find the local definitions  for  error\ncodes, due to the uncommon structure of the Synology file system.\n\nThis   error   was   fixed   in  the  Perl  development  git  for  version  5.19,  commit\n7a8f1212e5482613c8a5b0402528e3105b26ff24.\n\nFailing tests\n\next/DynaLoader/t/DynaLoader.t\nOne subtest fails due to the uncommon structure of the Synology  file  system.  The  file\n/lib/glibc.so is missing.\n\nWARNING:  Do  not symlink /lib/glibc.so.6 to /lib/glibc.so or some system components will\nstart to fail.\n"
                },
                {
                    "name": "Smoke testing Perl",
                    "content": "If building completes successfully, you  can  set  up  smoke  testing  as  described  in  the\nTest::Smoke documentation.\n\nFor  smoke  testing  you  need  a  running Perl. You can either install the Synology supplied\npackage for Perl 5.8.6, or build and install your own, much more recent version.\n\nNote that I could not run successful smokes when initiated by the Synology Task Scheduler.  I\nresorted to initiating the smokes via a cron job run on another system, using ssh:\n\nssh nas1 wrk/Test-Smoke/smoke/smokecurrent.sh\n\nLocal patches\n\nWhen local patches are applied with smoke testing, the test driver will automatically request\nregeneration  of  certain  tables  after  the patches are applied. The Synology supplied Perl\n5.8.6 (at least on the DS413) is NOT capable of generating these  tables.  It  will  generate\nopcodes with bogus values, causing the build to fail.\n\nYou can prevent regeneration by adding the setting\n\n'flags' => 0,\n\nto the smoke config, or by adding another patch that inserts\n\nexit 0 if $] == 5.008006;\n\nin the beginning of the \"regen.pl\" program.\n"
                },
                {
                    "name": "Adding libraries",
                    "content": "The  above  procedure describes a basic environment and hence results in a basic Perl. If you\nwant to add additional libraries to Perl, you may need some extra settings.\n\nFor example, the basic Perl does not have any of the DB libraries (db, dbm, ndbm, gdsm).  You\ncan  add these using iPKGui, however, you need to set environment variable LDLIBRARYPATH to\nthe appropriate value:\n\nLDLIBRARYPATH=/lib:/opt/lib\nexport LDLIBRARYPATH\n\nThis setting needs to be in effect while Perl is built, but also when the programs are run.\n"
                }
            ]
        },
        "REVISION": {
            "content": "July 2022, for DSM 5.1.5022 and DSM 6.1-15101-4, and DSM-7.1-42661-3.\n",
            "subsections": []
        },
        "AUTHOR": {
            "content": "Johan Vromans <jvromans@squirrel.nl> H. Merijn Brand <cpan@tux.freedom.nl>\n\nperl v5.38.2                                 2026-08-18                              PERLSYNOLOGY(1)",
            "subsections": []
        }
    },
    "summary": "perlsynology - Perl 5 on Synology DSM systems",
    "flags": [],
    "examples": [],
    "see_also": []
}